Document ba_put and ba_get signedness
Update documentation to include that `ba_put_X` and `ba_get_X` for bytes, shorts, integers and longs uses signed values.
(78be6f01 by pieter12345)
Fix sugared foreach() syntax parsing
- Fix `foreach(... in ...)` and `foreach(... as ...)` syntax parsing. Bug was introduced in build 4024.
- Make `foreach` use `__statements__` as in-between rewrite node instead of `sconcat`. No functional changes.
(a96d3afb by pieter12345)
Don't parse __autoconcat__ to sconcat in strict mode
Parse `__autoconcat__()` to the new `__statements__()` instead of `sconcat()` in strict mode. `__statements__()` takes arguments of any type and returns `void` for typechecking, so compile errors will be generated in cases where `__autoconcat__()` used to insert `sconcat()`s, or in other words, where the user has either forgotten to put some `.` concat, or where the user has made a mistake.
This change does not affect non-strict mode, as automatically inserting concats is a feature there.
Alias syntax should also remain possible in strict mode, but only when the whole alias is nicely concatenated together by the user. Inserting multiple arguments/statements will cause the code block to be interpreted as a statements block and not as an alias redirect.
(69f6baa6 by pieter12345)
Update ResourceManager.java
Provide a more detailed description in res_create_resource (e36e76df by ladycailin)
Merge pull request #1250 from Lildirt/hanging_place
Add hanging_place event (6a68260e by michael smith)
Bump junit from 4.12 to 4.13.1 (#1248)
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (f5ecef53 by dependabot[bot])
fix: pom.xml to reduce vulnerabilities (#1243)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-ORGYAML-537645 (70a3bc51 by snyk bot)
Add HIDE_DYE item meta flag
(41c54ddf by pseudoknight)
Add block_explode event
(2c666b7d by pseudoknight)
Fix split() for strings ending with the split
Allow `split()` (and non-regex `reg_split()`) to match the split on the last possible part of the string as well.
Fixes `split('b', 'ab')` resulting in `{'ab'}`, rather than `{'a', ''}`.
(b780a89b by pieter12345)
Merge pull request #1240 from Murreey/day-functions
Add get/set functions for world day (cdc6c62a by michael smith)
Fix cmdline install tool unsupported OS check
`OSUtils.GetOS()` cannot return null, so the previous check never triggered.
(5a471148 by pieter12345)
Fix entity_unleash reason in event docs
(ea2e3e27 by pseudoknight)
Add support for Minecraft 1.16.2
(7b0aad6f by pseudoknight)
Fix NPE in LangServ while generating environment (#1237)
Fix NPE in LangServ while generating the environment without having a profiles file in the MethodScript directory. This fix creates an empty ProfilesImpl, such that any usage of the Profiles object will simply be like if the profiles file were empty. (55a5e0a6 by pieter12345)
Handle exceeding max string size in string_multiply
- Detect when exceeding max string size in `string_multiply` and throw a `RangeException` when that happens.
- Optimize `string_multiply` implementation.
Fixes #1234.
(60f238b7 by pieter12345)
Fix smart strings being rewritten to non-strings
Rewrite smart strings to either a `concat()` of their string and variable parts, the string itself if no variables are present, or a `string()` cast variable if it consists of a single variable.
This ensures that smart strings will always have have the `string` type in user code.
Fixes #1232.
(4ef81cc4 by pieter12345)
Fix '@' escaping in smart strings
Pass literal `\` as literal `\\` to `__smart_string__`, so that `__smart_string__` can disambiguate between `"\@"` and `"\\@"`, rather than getting the same input for both.
As this function is an internal compiler function, and users that do use it would now have to pass double escaped `\` into the function to make it work properly, the function has also been renamed to `__smart_string__` to fit the other compiler functions.
Fixes #1229.
(1dd871ee by pieter12345)
Add entity_unleash event (#1227)
(566f8c72 by malonnnn)
Move static final function names to function classes
- Move static final function names to the static final `NAME` field in their corresponding function classes.
- Add a test that validates that when a `NAME` field exists in a function class, it will return the same value `func.getName()` returns.
(bf4419a9 by pieter12345)
Centralize function name references
Replace all hard-coded string function names and `new funcClass().getName()` with a static final field in the `Function` class. This puts all 'static' function references in one place, allowing for shared function name caching and an easier way to find all references to a certain function.
(bcf811d9 by pieter12345)
Persist running `x_new_thread` threads over recompiles (#1224)
Make threads remove themselves from the active threads map when they finish execution, rather than when the construct containing the thread ID string gets garbage collected. (3512ac46 by pietje)
Merge pull request #1223 from Pieter12345/delay-keyword-compile-errors
Allow keywords to be part of other syntax (1747e2f5 by pietje)
Don't remove if keyword on process error
Prevent the `if` keyword from removing itself from the AST when it fails to parse. This allows us to generate an error for it later, if it is not handled as part of some other syntax.
(980bd983 by pieter12345)
Don't rewrite AST on try keyword process error
Rewrite the `try` keyword processor to not make changes to the AST unless it can finish parsing without exceptions.
(1dcd0cb8 by pieter12345)
Allow keywords to be part of other syntax
Allow keywords to be part of other syntax than their keyword processing code is written for. An example is code `array(static: 1)`, which generates a compile error when attempting to process the keyword `static`, while it is actually part of valid `array()` syntax.
Fixes #1220.
(f496a780 by pieter12345)
Create AbstractCompileException
This exception should be used as parent exception for compile exceptions, and can be useful to handle any compile exception in a single catch clause.
(f44e6f58 by pieter12345)
Accept null arg in psend_block_change() to send existing block
(0b00fc75 by pseudoknight)
Fix cast exception for fireworks in projectile events
(7d6c37a7 by pseudoknight)
Add 'unexpected keyword/label' compile errors
Add "unexpected keyword" and "unexpected label" compile errors to static analysis. The caught cases are considered syntax errors and already caused a more generic 'fallback' compile error in static analysis.
(9c887c8d by pieter12345)
Add class name conventions
(68e56fe9 by ladycailin)
resource -> Resource
*Probably* no one was using this? The impact should be very low at this
point at least, but the longer we wait, the more impact it will have, so
I'm going ahead and making this hard cut now.
(5b26f52a by ladycailin)
Fix NPE in static analysis on re-including empty files
Fix a NullPointerException that occurs in static analysis when a file is included after an empty file has been dynamically included.
Fixes #1221.
(e83eed22 by pieter12345)
Proc arguments handling optimization
Set passed proc arguments first and then fill in the default values for the remaining arguments, rather than setting all default values and overwriting them with the passed proc arguments.
(1789f79a by pieter12345)
Fix proc @arguments order
Fix procedure `@arguments` order in the case that the procedure contains more arguments than the procedure call passes to it. This is only noticable when default argument values are given, since otherwise the order wouldn't matter.
Fixes #1197.
(18d26d2e by pieter12345)
Fix post parse AST rewriting for single-function scripts
Fixes post parse AST rewrites not using the rewritten AST for scripts with a single root function that is rewritten.
Fixes #1219.
(b752e1bb by pieter12345)
More feature for multithreading (#1214)
* More feature for multithreading
* Fix docs
* Fix x_thread_is_alive thrown
* Separation x_is_interrupted([id], [clearFlag])
* Interrupted status -> interrupt status
* Fix docs core.functions.Threading
* Fix docs x_clear_interrupt and x_is_interrupted (7df115a3 by udartsev anatoliy)
Fix bugs in localization ui
(f4b78d7f by ladycailin)
Add CRIMSON_FUNGUS and WARPED_FUNGUS tree types
(1a5ff308 by pseudoknight)
Add 'anchor_spawn' boolean to player_spawn event
(c8c2794d by pseudoknight)
Add SWAP_OFFHAND click type in inventory_click event
(eba81c00 by pseudoknight)
Add Strider's 'saddled'; Item Frame's 'fixed' and 'visible' to entity_spec()
(4b7613f9 by pseudoknight)
Fix legacy material builder on pre-1.16
(6ecc8df6 by pseudoknight)
Manage baby state for piglin, zoglin, and hoglin.
Fixes wrapper class for zombified piglin.
(093c41e0 by pseudoknight)
Update entity_explode to reflect changes in the underlying event.
A null entity is no longer possible.
(deab85b9 by pseudoknight)
Add support for Minecraft 1.16
(0fe660db by pseudoknight)
Add MCEffect.INSTANT_POTION_BREAK.
Remove unused id value from enum.
(bc3f00a0 by pseudoknight)
Make Script's 'right' field a local variable
(625ea38e by pseudoknight)
Fix color() docs not listing color names
(784191d9 by pseudoknight)
Static analysis optimization
Increase static analysis performance by creating less unnecessary collections.
(41eb7fbe by pieter12345)
Update portal events to reflect 1.15.1.
Add creationallowed event data. Fix searchradius and creationradius support in 1.13.2.
(d835316e by pseudoknight)
Add support for SQL Server in query and the PN (#1212)
(bbd3adac by ladycailin)
Fix header issue in telemetry.ini
Use UTC time in the telemetry event
(e6fe6c2a by ladycailin)
Add metric for static analysis
(889d8652 by ladycailin)
Lazily get keyword name from annotation.
The name was only used for exception messages, yet this method can be called multiple times per line, which was noticeable in profiling. This improves compile time around 6%.
(7afbf9d8 by pseudoknight)
Fix duping when getting held item meta on block_place.
The item's tags were being modified on read, causing this and probably other lesser issues. This affected shulker boxes, bee nests, beehives, and shields.
(d37f1a70 by pseudoknight)
Re-use environment for compilation (#1209)
* Re-use environment for compilation
This is an optimization which uses the same environment to compile multiple msa scripts, rather than creating a new environment every time. Environment creation reads and parses a few files, so this is an expensive operation.
* Create StaticRuntimeEnv for static final functionality
- Create StaticRuntimeEnv and move functionality from GlobalEnv to this class if it is static and final accross compile units.
- Replace reflection in RandomTests test with Mockito, as this allows for the accessed field to be made final like it should.
* Use a fresh environment per script
Clone the environment for every (msa) script. Since StaticRuntimeEnv returns itself when cloned, its contents act like a cache.
* Move test code out of production code
Use Mockito to mock unused environment objects instead.
* Use cheaper newline replacement in read()
There's no need to replace "\n" with "\n". (675fab07 by pietje)
Check for associative array usage in spawn_particle
Fixes #1210
(ca0531dc by ladycailin)
Add new methods in BukkitMCArmorStand
(726dd6a8 by ladycailin)
Speculative fix for case sensitivity in InjectedPlayers
(cc39b8f0 by ladycailin)
Fix NPEs in CClassType (#1208)
* Fix NPEs in CClassType
The CClassType invalidType is cached in a thread-unsafe way. This causes problems when LangServ is performing an operation on the same CClassType, since one thread can start using the Mixed[1] created by the other thread before it is populated with data, getting null when reading its first element.
* Switch LangServ back to cmdline mode
LangServ is currently running in EMBEDDED mode, which is a refactoring mistake. This commit changes it back to CMDLINE mode. (067118a0 by pietje)
Static Analysis patch (#1207)
* [SA] Fix exception on invalid typeless variable assign
- Fix exception during scope graph generation for assign(var, val) with an invalid variable type.
- For default or AUTO declarations, still require the value to be instanceof Mixed to prevent things such as void assigns.
* [SA] Fix NPEs in requireIVariable() and requireClassType()
Fix NPE in StaticAnalysis.requireIVariable() and StaticAnalysis.requireClassType() that occurs when passing in invalid syntax. Eventually, the parse has to catch these errors and halt compilation such that the AST in further steps only contains valid terms. For now, catch possible NPEs in the later stage and print invalid term classes instead such that it doesn't crash. (d8def74a by pietje)
Use cache instead of FunctionList lookups (#1206)
Cache the required environments for each function in CFunction and use that for lookups where possible. Also don't do FunctionList lookups where the function is already cached. This makes the flow as follows:
1. postParseRewrite() caches all existing functions.
2. Other compiler steps use the cached functions, or get null when they don't exist.
3. checkFunctionsExist() does a lookup in the FunctionList if the function is not cached, and generates the compile exception if it doesn't exist. (1b754e6a by pietje)
Merge branch 'master' of github.com:EngineHub/CommandHelper
(d7897501 by pseudoknight)
Optimize binds to get Event from BoundEvent when possible.
(9f294f4e by pseudoknight)
Improved registering/unregistering commands.
- unregister_command() will now remove all aliases and prefixed variants of the command, so it is symmetrical with register_command().
- unregister_command() now supports unregistering other plugin's commands.
- register_command() will now remove aliases that are no longer in the array, and add aliases that are added to the array.
- Improved documentation and examples.
(ccb1a64e by pseudoknight)
Merge pull request #1205 from Pieter12345/master
Fix exception target for single include() exceptions (3661ebd7 by michael smith)
Fix exception target for single include() exceptions
(47a242a8 by pieter12345)
Static analysis (#1198)
* Add basic static type checking framework
This is still a WIP. A few points to work on:
- A solution with less code in Function classes is preferred.
- To get the type of IVariables (which are non-existent in the parse tree?), some sort of scoping simulation should be added.
- Functions should be able to optimize based on the argument types that they receive. This allows for example sconcat() to not toString() its parameters when passed at least one statement that returns void.
* Fix broken javadoc
* Move function name validation to its own method
Move function name validation out of link() and link() before optimization.
* Fix or() typechecking implementation
Support 0 to n arguments, rather than 2.
* Add static analysis framework
Functions that have scoping behavior or functions that make declarations / references to variables/procs/etc should override the linkScope() method.
Variable references are already checked at this point, but declarations are not.
Comes with a boolean to do or don't do static analysis. This is necessary to run optimization tests that are semantically incorrect.
* Implement variable declarations
- Creates declarations in the scope graph for variables passed to assign().
- Throws a compile error on variable declarations in places where that variable is already defined.
- Converts typeless assigns into declarations of type AUTO when variables are not yet declared, but are being assigned to.
* Implement ControlFlow scopes
* Implement closure scopes
* Implement bind scope
* Implement proc scope
Proc declarations are being made (without signature), but references are not checked yet. This commit is mainly about the proc declaration scope behavior.
* Disable static analysis for 'invalid' tests
These tests exist to test other things. Static analysis isn't necessary here.
* Disable static analysis for composite functions
Composite functions come with an inj... (5c503dbf by pietje)
Clean log tests (#1202)
* Clean log tests
* Clean tests with dyn() (3ef53379 by udartsev anatoliy)
Throw NPE on clear_task(null).
Fixes #1201
(eeb3b33a by ladycailin)
Update public suffix list
(cff540be by ladycailin)
Fix getting offline players by name in offline mode
(9e938ad7 by pseudoknight)
Merge pull request #1199 from Anatoliy057/patch-1
Delete duplicates in entity_spec (e680b563 by michael smith)
Delete duplicates in entity_spec (822aa4e1 by udartsev anatoliy)
Correct exception message for integer() (Fixes #1193)
(268cfd4e by pseudoknight)
Update make_effect().
This adds data support for material and facing names, and improves documentation.
(010a2544 by pseudoknight)
Fix reflect_type, add copy button to code on site.
Update jQuery. Exclude LLVMFunctions from trying to be site-deployed.
Add documentation on options for bind. Rename
getSuperclasses/InterfacesForType to getTypeSuperclasses/Interfaces.
(53916597 by ladycailin)
Fix new assignment not getting the defined target.
(e2ab8089 by pseudoknight)
Get CommandSender for executeas() and scriptas().
This allows for injected players that are currently offline, which is already a possibility for closures. Also now checks if executeas() has the minimum number of arguments and updates the docs. (Fixes 1194)
(309df09d by pseudoknight)
Fix extraneous bare string warnings in tests
(f111a7a8 by pseudoknight)
pass current MCCommandSender on null for executeas (#1195)
* pass current MCCommandSender on null for executeas
* CH syntax requirements
* use current env not the closures (2c6dbab2 by luke fairchild)
Implement Booleanish in remaining classes
(0a50d664 by ladycailin)
Add reflect_type, class_type, and Typing documentation.
As part of writing examples for the documentation, I came across the error in #1192,
which allowed me to reliably reproduce it, so this fixes #1192 also.
(b8a07c42 by ladycailin)
Fix negative array index lookup overflow messages (Fixes #1188)
(5813d34e by pseudoknight)
Fix incorrect ivar redefined error message in loops.
(52316a72 by pseudoknight)
Fix documentation in reflect_pull
(64bc0956 by ladycailin)
Add pflying(), pblocking(), psprinting() and is_entity_sleeping().
These are more readable than using pinfo().
(8799c64c by pseudoknight)
Improve set_blockdata docs
(62849f8e by pseudoknight)
Add entity immunity functions
(1ffa65d0 by pseudoknight)
Add "model" item meta key for matching functions
(ef8ea789 by pseudoknight)
Don't rely on appspot for the site to load.
Need to replace this longterm with apps.methodscript.com, but this is a
short term fix, and a better approach regardless of which particular
site we rely on.
(87bf7727 by ladycailin)
Add support for telemetry
This branch adds the ability to send telemetry data to Azure Application Insights. This proxies through apps.methodscript.com however, so in addition to the basic telemetry framework, this also includes the swagger framework, which both the server and the client have autogenerated code for. See the LadyCailin/apps.methodscript.com repo for the server side of this. Telemetry is diabled by default, but nags the user to enable it where relevant. (3c799335 by ladycailin)
Fix cmdline file access security checks (#1183)
- Bypass Security.CheckSecurity(File) checks in cmdline mode.
- Move existing in-cmdline-mode checks before Security checks, since Security checks can throw an IOEx that shouldn't have to occur in cmdline mode. (596a64b5 by pietje)
Add missing CommandHelperEnvironments (#1184)
Add CommandHelperEnvironment `@api` annotation arguments for Minecraft dependent functions, such that these functions can no longer be used in cmdline mode (and crash due to NoClassFoundDefErrors). (3a7df5ec by pietje)
CheckStyle (#1182)
Fix CheckStyle violations. (c1fa0522 by pietje)
Parallelize startup and deduplicate work at startup.
This shaves off about half a second on my system.
(dfa23310 by ladycailin)
Add player prefilter to pressure_plate_activated event.
(1e4034bf by pseudoknight)
Improve target for unexpected end curly braces.
Fixes EmptyStackException when encountering more than one unexpected end curly brace.
(e052ce22 by pseudoknight)
fix: Fix bug #1180 misspelled class name (#1181)
The DuplicateObjectDefintionException.java class is misspelled,
it should be DuplicateObjectDefinitionException.java
This commit fixes the class name.
Resolves: #1180 (d118a918 by alejandro casado quijada)
Add initial llvm framework.
This currently mostly just includes the LLVM installer, but also
includes a first pass at actually compiling a simple mscript program.
The biggest issue right now is actually just figuring out the llvm ir
necessary, so I've short circuited this right now, making it currently
unusable, but neither the wrapper IR nor the exit() function itself are
properly implemented yet anyways.
(2064220a by ladycailin)
Fix puuid() returning invalid UUID for invalid name.
Optimize get_offline_players().
(dd8b5258 by pseudoknight)
Fix bug where errors in events in cmdline would fail to render the error properly
(c86736df by ladycailin)
Fix hidden function issue on the site
Fixes #1175
(5026fe9a by ladycailin)
Fix class load warnings for extension dependencies
(90f7bef0 by pseudoknight)
Set alias functions to CommandHelperEnvironment
(7592c6e8 by pseudoknight)
Ensure server type is set for fast startup modes
(6be24775 by pseudoknight)
Improve clarity of player event warning.
Saying it's "missing" is misleading, and the cause is unlikely to be an NPC anymore.
(ef32fe0d by pseudoknight)
Improve API docs for clear_commands(), spawn_entity(), and player_interact
(15614fde by pseudoknight)
Add phantom size to entity_spec
(b1511e00 by pseudoknight)
Finish work on search bar on the site
(c06d22fe by ladycailin)
fix: pom.xml to reduce vulnerabilities (#1177)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-COMMONSCODEC-561518 (a02a5bdb by snyk bot)
Site search is 80% complete now
(d7b8e99e by ladycailin)
Update switch() documentation (#1176)
(b063add0 by pietje)
Override deepClone in CByteArray to allow cloning byte_arrays
(74d14857 by ladycailin)
Update VersionFrontPage
Update link to bug tracker. (1101071d by ladycailin)
Warn on use of variable named pass/password
Also, allow PATCH http verb, though it looks like java still prohibits
that at a deeper level, so need to do some playing dirty to finish
making that work.
(1cc870d4 by ladycailin)
Fix interpreter mode stopping on compile error (#550)
- Fix in-game interpreter mode from disabling when the executed code results in a compile error.
- Prevent players from being set to interpreter mode through the CommandHelperInterpreterListener.execute() method. (18dc2828 by pietje)
Bump checkstyle from 8.28 to 8.29 (#549)
Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 8.28 to 8.29.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-8.28...checkstyle-8.29)
Signed-off-by: dependabot[bot] <[email protected]> (cc89f729 by dependabot[bot])
Merge pull request #548 from Pieter12345/master
Add get/set_skull_owner functions (0fa2489d by michael smith)
Add get/set_skull_owner functions
These functions can be used to get/set/clear the skull owner on player heads.
(701f4a79 by pieter12345)
BukkitGetCorrectBlockState optimization
Divide into a Container or not-Container check to do roughly half the checks on average.
(e68358bf by pieter12345)
Fix BukkitMCBlock returning wrong BlockState
(d7a653d2 by pieter12345)
Fix cases where a branching implementation error is incorrectly detected
(5fdf61ed by pseudoknight)
Fix quantity remaining when attempting to add empty items to a full inventory
(e4a5d39f by pseudoknight)
Enable all event functions in cmdline
(c2a2cc2f by pseudoknight)
Update CheckStyle (#547)
* Fix obvious JavaDoc syntax errors
No functional changes.
* Update CheckStyle
Update CheckStyle to be compatible with the latest version. This prevents users from getting errors from IDE CheckStyle plugins that use the latest CheckStyle version.
(cd0ef419 by pietje)
Quote argument in bash launcher
(e73a7649 by ladycailin)
Add new gamerules for 1.15.2
(31084c29 by pseudoknight)
Merge pull request #546 from Pieter12345/master
Fix NPE in entity_spec for Enderman (298ed5c0 by michael smith)
Fix NPE in entity_spec for Enderman
Fix calling entity_spec on an Enderman that is not carrying a block resulting in a NullPointerException.
(a6b0edbb by pieter12345)
Use https for pluginRepositories
(50102b59 by pseudoknight)
Remove remnants of old documentation deployment
(fcaac78d by pseudoknight)
Use https for repositories
(07d13cdf by pseudoknight)
Fix misleading documentation
(5be884b1 by pseudoknight)
Set nested array parent when creating array using labels.
Fixes old string representation for parent array being returned even after nested arrays are modified.
(a74a09c4 by pseudoknight)
Update Advanced_Guide
Define UTF-8 as the standard source file encoding. (8f853814 by ladycailin)
Update Crypto.java
Sha-1 has now been totally broken, so make a note of this in the documentation. (97f543e7 by ladycailin)
Update PlayerManagement.java (#545)
Pfacing() documentation was incorrect. It indicated yaw 0 is dead west and 90 is north, but all the testing I'm doing is showing 0 as south and 90 west, etc. Same for pfacing(F). It says 0-West, 1-South, 2-East, 3-North. My testing shows F0=South, F1=West, F2=North and F3=East. (7d5c44e1 by jjkrause)
Add lockable block functions
(ea07e0fe by pseudoknight)
Merge pull request #544 from Pieter12345/master
Add affectedBlocks to piston_retract event (f1f9cd93 by michael smith)
Add affectedBlocks to piston_retract event
Add affectedBlocks key to the piston_retract event. This is used when slime or honey blocks are pulled, pulling adjacent blocks with them.
(3e6eccc5 by pieter12345)
Add separate light level functions for sky and block sources
(c88780cd by pseudoknight)
Add BEEHIVE SpawnReason for 1.15.1
(330f1cff by pseudoknight)
Fix bug in StringUtils.HumanReadableByteCount.
There's an interesting story behind this, see
https://programming.guide/worlds-most-copied-so-snippet.html for the
details if you're curious. Also, I have proper attribution for the code
snippet now as well.
(e51603d8 by ladycailin)
Add support for Minecraft 1.15
(7f001718 by pseudoknight)
Fix bare string warnings in sample scripts
(b6aa64b8 by pseudoknight)
Support virtual inventories for get_inventory_name()
(06a064dc by pseudoknight)
Add vex charging to entity_spec()
(85f41eee by pseudoknight)
Update docs for player_interact
(706a3c64 by ladycailin)
Begin work on a built-in webserver
(aa617823 by ladycailin)
Add support for particles that require additional data in Area Effect Clouds.
Make particle data creation more forgiving.
(e614b254 by pseudoknight)
Add timeout to GCUtil.
It really is just best effort to call System.gc, so we can't make this
work in a generic way, without a JNI integration perhaps.
(01e37d42 by ladycailin)
Reverse debug flag in GCUtil
(7cd37d00 by ladycailin)
Begin work on CGI directions in IIS
(a1a86eb7 by ladycailin)
Ignore keywords again when checking bare strings
(444167e7 by pseudoknight)
Check only native types in Construct for isInstanceOf(). (#543)
This is optimal in cases we can expect it to not be a UserObject. (e9735c84 by michael smith)
Fix core error when trying to set an ocelot type in 1.14 in deprecated spawn_mob()
(da19ddd0 by pseudoknight)
Add a fallback for getting a player entity when its missing from a world's entity list.
(98c85f4e by pseudoknight)
Document deprecated MC functions better
(50ff6758 by pseudoknight)
Add several entity attribute functions.
Also fixes item attribute meta when modifier name is null.
(a8235180 by pseudoknight)
Add BlockUntilGC method.
This wraps System.gc(), but provides a way to actually ensure that a
garbage collection has actually run. This is no still guarantee that a
given object has been garbage collected, but is as good as it can get
from a java code perspective. There are a few places where System.gc()
has been changed to use this new method instead.
(c444b1d5 by ladycailin)
Exclude dependency conflict.
The conflict causes NoSuchMethodError for Spigot methods in BukkitMCItemMeta. Relocation alone can't resolve this. Initially included for lsp4j, com.google.common.collect doesn't appear to be used in the functionality LangServ is using at the moment, and so it should be safe to exclude it for now. This also reduces the jar size.
(7aee86ec by pseudoknight)
Support attribute modifiers in item arrays
(337b9808 by pseudoknight)
Add dark mode to the website.
Actually, this is more like "dark theme" because the mechanism is a
generic theming mechanism, which should be pretty straightforward to add
other themes to down the road. Simply add a new theme css file in
resources/css/themes, and add a link to it in the place specified in
frame.html (ensuring that the data- attribute is there). The rest should
figure itself out on its own.
(2478f798 by ladycailin)
Scrub it in both places...
(23bb6264 by ladycailin)
Scrub password from error message
(e9d2a9f1 by ladycailin)
Update docs for extraParameters in MySQL connection
(43d03996 by ladycailin)
Add proper separator for extra parameters
(d5ff95bb by ladycailin)
Add support for arbitrary parameters in mysql persistence
(93d736d7 by ladycailin)
Bump mysql connector from 8.0.16->8.0.18
(fe09cbfa by ladycailin)
Add get_cmd_completions()
(7c73cae7 by pseudoknight)
Add documentation for running as a CGI script.
This is not advertised, since this is mostly just proof of concept, but
for completeness sake, this is the documentation for how to set it up,
if that becomes useful to link to people in the future.
(758ad8c0 by ladycailin)
Add better grouping in prefs files
(b72cfc54 by ladycailin)
Fix incorrect warnings of missing players in events.
(e9c11a99 by pseudoknight)
Fix numArgs for enchant_item() and change arrow damage to doubles
(ecfcde82 by pseudoknight)
Fix exception matching in old try() function format
(4a6cc6fe by pseudoknight)
Expand edit-prefs command a bit
(c7f4aab2 by ladycailin)
Add edit-prefs command, which opens the prefs directory in a text editor
By default, vim/VSCode is used depending on platform, but this can be
overridden with environment variables, or by command line parameter.
Also fixed bug where the java version in the windows wrapper was
wrong.
(ff15ef91 by ladycailin)
Use exe wrapper on Windows
There was a bug with the old batch->powershell->java wrapper when it
came to quoted arguments. To fix this became a rabbit hole, and it ended
up being easier to just revist the C# wrapper. This removes the
ClickOnce installation, so this is just a simple wrapper executable.
Still need to revisit the installation mechanisms later to re-add double
click support in windows, but for the time being this is good enough as
a replacement in cmdline.
(a77ca4b9 by ladycailin)
Improve bare string detection and limit to one warning per file
(7350575e by pseudoknight)
Add villager experience/level and panda genes to entity_spec
(6c596d94 by pseudoknight)
Support categories with spaces in them.
For some reason, Java's Preferences class parses spaces as if they were
=, so categories with spaces in them don't work right. If the key simply
starts with left bracket, then we skip the whole value.
(9118c597 by ladycailin)
Add help-topic command, which reads Learning Trail topics
This functionality is also available to extensions, through the
getHelpTopics() function in the Extension interface.
(b8cd9e15 by ladycailin)
Support grouping in preference files
Add a few groups to the preferences.ini file also, to take advantage of
this new feature. Groups are sorted alphabetically, and within groups,
items are sorted alphabetically, though within the group, another sort
order may be given to override this. This allows for more precise
sorting of values, and for larger preference files, makes them much
easier for users to read. Values without a group will be placed at the
top of the file.
(ae406b32 by ladycailin)
Use simple name for exceptions on API page
(d252b26c by pseudoknight)
Lower-case material enums for blockdata
(d46cb4bb by pseudoknight)
Always do ExtensionManager init, since we need to for cmdline tools
(5043191d by ladycailin)
Preliminarily support untitled files in LangServ
Also modify_event does not need CHEnv.
(8c94a049 by ladycailin)
Add SemVer2, an implementation of Version that supports Semantic Versioning
This is currently only used in MSVersion, and is not intended to
necessarily be a replacement for SimpleVersion, as it is more strict,
and only useful when a platform can dictate the version number format.
This will come in useful later, however.
(f2fe6cd7 by ladycailin)
Add support for method line numbers (ish) in ClassDiscovery
The line number the method declaration is on isn't actually available in
class files, so it's not possible to get that directly, but we can get
a relatively close proxy, the line number of the first executable
statement. This is good enough for most purposes, which is to direct
users attention to roughly where the code is defined. This will
hopefully be good enough for most purposes, because it's the best we can
do without actually parsing java source code.
(9fe1287f by ladycailin)
Make array_index_exists work with negative numbers in normal arrays
(9a00f477 by ladycailin)
Fix bounds exception when a brace is used inside brackets (CMDHELPER-3165)
(6d5d7e73 by pseudoknight)
Merge pull request #542 from PseudoKnight/master
Fix issues w/ multiple contiguous symbols in assignment (CMDHELPER-3174) (a90f47b7 by michael smith)
Fix issues w/ multiple contiguous symbols in assignment (CMDHELPER-3174)
(2d949910 by pseudoknight)
Fix serializing closures with labels in them
(4c847390 by ladycailin)
Disabling logging of compiler warnings in interpreter mode
(6f6f5b75 by pseudoknight)
Fix core error when compile error affects branching
(9fd1bcbc by pseudoknight)
Fix NPE when foreach() given invalid argument format
(3d7d61df by pseudoknight)
parseXML first, so the server content-type doesn't matter
(69497b37 by ladycailin)
Continue work on localization
Still several tasks to be done before this can be crossed off, but the
matching is pretty good now on the front page. Remaining tasks detailed
in src/main/java/com/ls/tools/docgen/l10n/TODO.md. Also fixed a bunch of
examples that were throwing compiler warnings due to bare strings.
(1fe82b46 by ladycailin)
Support executing closures in variables using function syntax.
This is an early implementation that makes `@closure(@arg1, @arg2)` equivalent to `execute(@arg1, @arg2, @closure)`. Also fixes LangServ incorrectly checking procedures as functions.
(7e489298 by pseudoknight)
Improve handling of improperly formatted docs().
This prevents the vscode extension and json-api mode from entirely breaking when given an extension with bad docs, and gives a more helpful message in vscode.
(62e6867e by pseudoknight)
Add switch_ic, an ignore-case version of switch
(257909e8 by ladycailin)
Add support for varying priorities of warnings
Different warnings are classified differently in the LangServ, including
the low category, which prevents the issues from showing up in problem
lists.
(621c79bb by ladycailin)
Use event name target instead of bind function when event does not exist
(9991bdbd by pseudoknight)
Prevent extension startup in LangServ
(291befb1 by pseudoknight)
Add better logging for an Error thrown in optimize
(49256148 by ladycailin)
Don't loge on exceptions in document link
(e7c7abe2 by ladycailin)
Stop compiling on change, and do compile on save only.
A delay needs to be implemented, otherwise for larger source files, this
causes useability issues, since it would attempt to be compiled once per
character typed. Creating a delay is necessary, so it waits until no
changes have been made for a delay, and only then compiling once. In the
meantime, it will just have to be compile on save.
(2034cb78 by ladycailin)
Support multiple paths in base-dir
(032a0dac by ladycailin)
Add compiler warning for functional usage of operators
This commit adds a compiler warning for when functional notation is used
for a function that supports an operator syntax. This only occurs in
strict mode, and is still suppressable.
(e5e1ec1a by ladycailin)
Fix dor() when no values are truthy
(1a24743b by pseudoknight)
Add an optional player argument to sudo()
(2cbffbd3 by pseudoknight)
Use proper document models on change
Previously, we just always read from the file system to get the document
truth, but that caused issues, and also required users to save to get
the compilation hints. Now, the document is only read from disk if the
client isn't managing it, otherwise, it reads it from the internal cache
which is managed by the client for open files.
(f1617cf4 by ladycailin)
Update tellraw functionality.
This fixes ptellraw() for non-ops, adds tellraw() for running from console, adds default selectors, and updates documentation and examples to explain the differences.
(cb1c84b5 by pseudoknight)
Remove and ignore test file
(2763fcd8 by ladycailin)
Remove compile time caching of includes.
This is too aggressive of a change for now. However, I am keeping the
warning if the file doesn't exist (which is now suppressable).
(219480d1 by ladycailin)
Compile included files at compile time.
Also add DocumentLink support in the Language Server. This is
implemented in a generic way, so extensions can take advantage of this,
and if I missed any functions, it should be trivial to add them to the
system later as well.
(1446d8a3 by ladycailin)
Properly support msa files in LangServ
(f19e1948 by ladycailin)
Keyword errors don't stop compilation
Also added object related keywords, which currently all give compile
errors. This could break code, but it was going to break sooner or later
anyways. Also fixed issues with file options in most of the native
classes.
(305ccd99 by ladycailin)
LangServ now scans the full workspace on the low priority queue.
This allows for compile errors to be shown in all files, not just the
ones that are open.
Fix concurrency issue in NativeTypeList.
(8be301d1 by ladycailin)
Add checking of bare strings.
In strict mode, this is a compile error, in non-strict mode, it's a
suppressable warning.Add checking of bare strings.
(0b7ee4b0 by ladycailin)
Don't startup extensions in json-api or verify cmdline modes.
This increases the number of current extensions that are usable in these modes.
(964e9433 by pseudoknight)
Add support for stdio based language clients
(d51c0e52 by ladycailin)
Enable compiler warnings and fix but in json-api
Compiler warnings were just printed to the log, but couldn't be returned
in a usuable format by the language server. Now, in addition to logging,
the warnings are added to the compiler environment, and can be retrieved
later. Unfortunately, this meant that the lexer needed access to the
Environment, so a new parameter needed to be introduced, and that caused
lots of code changes.
Additionally, older extensions that lacked the MSExtension annotation
would cause issues when loading, because that caused the json-api
command to fail. This fixes it so that if the identifier would be
missing (thus causing a NPE), we generate an identifier based on the jar
name. The VSCode Extension only loaded the language server after the
json-api call completed successfully, so this fixes that issue as well,
if the user has older extensions.
(6771f58e by ladycailin)
Move target to string in regex functions
Also offset column by -2. This is probably done in the wrong place in
the code, but this is a quick fix that can quickly be reverted once the
compiler itself is fixed.
(15ecf79a by ladycailin)
Implement a basic language server.
This includes support for code completion, as well as error checking!
There are a few issues still, for instance, event and object completion
is not working, I'm not entirely sure why not, but that can be solved
later.
(78f4cd03 by ladycailin)
Add player statistic functions
(28b18d38 by pseudoknight)
Continue work on the language server.
The basic RequestMessage framework is complete, and we succesfully read
in most of the initialize method parameters. It's quite a large method
though, and converting the typescript to java is tedious, so there is
still more work to be done before the request itself is finished, but
the framework is complete and works well, so it's just a matter of
finishing the conversion. After that, I need to work on the framework to
handle responses, and that's the next big task.
(642834db by ladycailin)
Add documentation about how to use extensions
(3d85856a by ladycailin)
Use cached Function in CFunction (#540)
(bddf2ded by michael smith)
Support void in booleanish (falsey value)
(e257473b by ladycailin)
Add support for enums in JSONUtil
(514f4c87 by ladycailin)
Disable ElementSignature for now
There is an unaccounted for signature type, if a method returns a non
static inner class, in an outer class which contains generics, this
breaks processing, and causes a StackOverflowError. Therefore, since
this functionality isn't directly needed, I'm just disabling it for now.
Before it can be re-enabled, this bug will have to be fixed.
The binary name that it fails on is something like:
"()Lobj/Name<TT;>.InnerClass"
(7b19bd85 by ladycailin)
Fix player() in events where the player is offline
(770e1f17 by pseudoknight)
Begin the basic structure of the LanguageServer
I have also created a basic json->java object->json mapper utility. It
has very basic support, but it is in some ways an improvement above
gson, and allows for generic support in a bit of an easier way. Due to
type erasure, there are still serious problems with really supporting
this unfortunately, but this is probably the best that can be done. One
remaining task is to implement enums support, before the work on
implemenation of the language server protocol can begin in earnest.
(8b888a57 by ladycailin)
Improve operation time when getting a list of types (#539)
TreeSet is much faster since it doesn't have to hash the CClassType. It might even be faster than ArrayList in this case. (c20276f9 by michael smith)
Don't use concurrent hash map v2.0
(deb202ad by ladycailin)
Don't use concurrent hash map
(ae6d1340 by ladycailin)
Cache getAnnotation result
(595f2b5c by ladycailin)
Use cached CClassType earlier in isInstanceOf() (#538)
This avoids getting the FullyQualifiedClassName from the annotation again. (3059810e by michael smith)
Git push origin masterMerge branch 'Pieter12345-trigger_support2'
(5b78b4e2 by ladycailin)
Update to newer code styles
(7742ab0d by ladycailin)
Merge branch 'trigger_support2' of https://github.com/Pieter12345/CommandHelper into Pieter12345-trigger_support2
(2afb174c by ladycailin)
Merge branch 'master' into trigger_support2 (b33c2f06 by ladycailin)
Trigger Travis CI build
The last build timed out.
(84f109c3 by pieter12345)
Merge branch 'master' into trigger_support2 (5b5c7753 by pietje)
Hide trigger function
Since the trigger() function is completely broken at this time, nothing depends on it. Its documentation should not be on the API for the time being. Hiding this function will also allow us to change its behaviour and implement it properly without breaking peoples scripts.
(70d872c4 by pieter12345)
Fix severe NPE on trigger() + add broadcast_message trigger support
- Using the EventBuilder class always resulted in an exception since its static code block threw a NullPointerException. This was caused by attempting to find a BindableEvent implementation for an (in)direct child through only its interfaces, instead of its interfaces and interfaces of (in)direct superclasses.
- Add trigger() support for the broadcast_event event.
(4522cbe0 by pieter12345)
Remove CommandHelperEnvironment from the standalone environment
(c3f25a5c by ladycailin)
Give the Main class some TLC
All cmdline tools are in the new @tool format, and the docgen for the
tool should be back to being complete, and should also be more accurate
as well. The verify tool has a few more options added now, particularly
it was too difficult to load extra extensions previously, but with the
new format, this was easy to do, and is now done.
(9bc6382c by ladycailin)
Add a check for environment in the compiler
This considerable change now adds a distinction between embedded and
core functions. Embedded functions have a dependency on
CommandHelperEnvironment, and core functions are available everywhere.
Now the compiler makes a distinction between the two, allowing for
compile time errors for functions that aren't available in that
environment. However, there is a need in some cases to compile against
other environments, so the tooling and compiler infrastructure has been
modified to support the notion of a target environment, not the current
runtime environment, hence the size of this change. Additionally, some
tooling, such as the verify tool takes advantage of this distinction, to
allow users to specify what environments they actually want to compile
against.
(5004af66 by ladycailin)
Update the Metrics class for bStats
(f5efbed6 by pseudoknight)
Add missing item meta into documentation
(9f03cd22 by pseudoknight)
Rewrite item meta documentation
(3228e449 by pseudoknight)
Add update operation and fork operation
Also created a framework to easily wrap github api functionality. The
update operation is accessed from the File menu, and essentially is a
git pull on the local repo. The fork operation forks the master repo on
github, clones it locally, then loads it in the UI. Next up is creating
a mechanism to make commits and then make a PR back to the master repo.
(89f1f509 by ladycailin)
Add github auth to L10N app.
Mostly this was just about expanding support in the OAuth functions to
be more robust. It should correctly support more OAuth implementations
now.
(d741a9d9 by ladycailin)
The basic features of the l10n ui work, segments are replaced
The basic features of the UI are all completed now, including the
machine translation integration with azure. There are still a few minor
features that need implementing, particularly the segment search
feature, the segment filters, and the help file needs to be brought up
to speed.
The basic replacement logic for the site is implemented as well, and
should start working if pointed to a translation DB in the settings,
however, the replacement is still not working in several edge cases.
Additionally, the site deployment pipeline will need to be updated
with the translation DB link once it exists. The logic to select the
language needs to be implemented as well.
Futher, there are still lots and lots of segments that shouldn't be in
the DB, and so I need to add some more filters to get rid of several
hundred more. By and large however, the segmentation logic is complete,
and anyways bogus segments are a lower priority. The main blocker at
this point is the re-application logic on the site.
There are a few other things on the website that bypass the segmentation
logic currently, particularly menu items and other strings that are
defined in frame.html. I think the best approach here is to just
manually create entries for them. The UI can probably be modified to add
a hidden UI to add new segments, such that it hampers people enough to
not casually add segments, but still allow the rare cases where that
makes sense to easily and consistently occur, and take full advantage of
the UI's validity checking.
(c7d8e9ea by ladycailin)
Update recipes to support 1.14 recipe types, input choices, recipe book 'group', cooking 'experience', and 'cookingtime'.
This also finally removes legacy support for '0:0' format.
(c61d9310 by pseudoknight)
Add and improve command tabcompleter examples
(9c6095cb by pseudoknight)
Fix 1.13.2 compatibility
(21c1d57e by pseudoknight)
Load extension classes synchronously.
CMDHELPER-3179
(0eac533e by pseudoknight)
Log error message when the incorrect jar is used
(c0ccab3b by pseudoknight)
Add get|set_blockdata() functions that support blockdata arrays
(e4e791f0 by pseudoknight)
Add item matching examples for inventory functions
(5c43a363 by pseudoknight)
Fix error during compile when proc is not given ivars after classtypes
(4f98c63a by pseudoknight)
Update SourceVersion for annotation processors
(f0a6eaee by pseudoknight)
L10N Interface is useful now!
Changing settings and saving works now, which is enough to move on to
the next step, which is making a local deployment of the site use the
translations. There are still a lot of steps to go back and finish up,
but I want to get this validated first, so I'm moving on.
(85df0cdc by ladycailin)
Merge pull request #536 from EntryPointKR/master
Add all_materials() function (89017ed2 by michael smith)
Using isLegacy() instead of startsWith()
(47190413 by entrypointkr)
Add all_materials() function
(2b28b20f by entrypointkr)
L10N - Summary segment display works now
(231c27d8 by ladycailin)
Fix concurrency issue in async_read
(b624e3fa by ladycailin)
Continue work on localization UI
(7010d012 by ladycailin)
First pass at creating UI for localization
Most of the periphrial UI components are in place, but a few minor
things still need doing.
(44351ec8 by ladycailin)
Fix NPE when the item is null (#535)
(8fdc1d47 by junhyeong lim)
Continue tuning segmentation logic
(a530bb0e by ladycailin)
Nearly finished with segmentation.
Still need to do a comprehensive review, but by and large it appears to
be correct now.
(3852734e by ladycailin)
Generation of the memory files is nearly complete.
Still remaining to do is to finish the segmentation. After that, the
remaining total tasks are to write a localization interface for
localizers to use, and of course make the site use the translations.
Finally, we need to go through all the summary file translations, and
decide if a translation is eligible for machine translation or not.
Strings that have no values that need to be kept in english can be
marked as such, and all locales will accept the machine translation for
that string. Then, a tool to actually do the machine translation for the
eligible values needs to be written.
(cc45597d by ladycailin)
Fix composite function stack trace
(a8d201be by ladycailin)
Fix unknown target in CompositeFunction (#534)
* Fix unknown target in CompositeFunction
* Not can be cached
* Change to catching exception for setTarget
* Only set if target file is unknown
(047831b1 by junhyeong lim)
Merge pull request #533 from EntryPointKR/master
Fix api usage of offers in item_pre_enchant (2da3ea62 by michael smith)
Fix api usage of offers in item_pre_enchant
(304395a3 by entrypointkr)
Fix example in get_values
(ff0407f0 by ladycailin)
Add profiling of compilation of individual files
(eb6f95cc by ladycailin)
Begin work on site translation framework.
This is still not done, and the generated memories are not currently
useable. However, this is a good enough of a stopping place for now.
Still to do is to parse tables, which will solve most of the remaining
problems on the translation memory side. Still to do is write out the
individual pages memories, as well as of course set the site itself up
to start using the translations, but this is a good start on the
process.
(458a3500 by ladycailin)
Add ptellraw, which is a simple wrapper around /tellraw
(2c1e900a by ladycailin)
Fix listing dynamic enums in documentation
(467bd445 by pseudoknight)
Add fireworks "strength" and "effects" to entity_spec()
(8268c0e5 by pseudoknight)
Fix TC build status badge
(0c1d0b2c by pseudoknight)
Update build status badge
(8f6841fa by pseudoknight)
Add resource_pack_status event
(3b5cb360 by pseudoknight)
Add html description to api function pages
Fix line length in SiteDeploy, and collapse lambdas.
(9866ea7e by ladycailin)
Merge pull request #532 from jb-aero/trade
Recognize Wandering Traders as Merchants (847174ba by michael smith)
Recognize Wandering Traders as Merchants
(c2f6c414 by jb-aero)
Add autoReconnect=true to mysql profile
(6426a8a4 by ladycailin)
Fix more outdated links in documentation
(21ecde57 by pseudoknight)
Fix some event documentation
(ff36a0c7 by pseudoknight)
Fix numArgs for set_mob_effect() too
(9b6461a0 by pseudoknight)
Fix numArgs to allow set_peffect icon parameter usage. (#531)
(ea3a36f0 by bardi harborow)
Deploy jar to root as well
(78bd06fd by ladycailin)
Fix build issues in other platforms
(88a283df by ladycailin)
Add pre-push commit hook to build first
(e491b771 by ladycailin)
Add complex example to parse_args
(3796bd70 by ladycailin)
Fix iclosure() execution polluting the stacktrace
(72962e0b by pseudoknight)
Fix outdated links and Minecraft item ids in docs
(8a62aeb0 by pseudoknight)
Allow ~console for scriptas() and executeas()
(7b7e3dc9 by pseudoknight)
Fixed issue where ArgumentParser failed to validate long args
(691d1d42 by ladycailin)
Change default of USE_COLORS to always be true
Not sure why it was dependent on OS before, but it works perfectly
fine in modern versions, so we'll default to "useful".
(beb2cca4 by ladycailin)
Fix capitalization on documentation replacements
(380aa4fd by pseudoknight)
Now the jar uploads itself with site-deploy
Meta.
(4757e6f5 by ladycailin)
Fix bug that prevented some pages from being generated
(2dbd7073 by ladycailin)
Fix bug that prevented many pages from uploading
(e9e7d41f by ladycailin)
Provide directions for testing site deploy locally
Also have the FrontPage automatically redirect to VersionFrontPage,
instead of requiring selection of the version. Add a link to the version
directory in the VersionFrontPage.
(b61a184e by ladycailin)
Merge pull request #530 from PseudoKnight/master
Fix void handling for proc return types and assignment (f5bc5d67 by michael smith)
Ignore returned value's type when procedure's returnType is auto
(ebe6fb12 by pseudoknight)
Fix void handling for proc return types and assignment
(38d94b78 by pseudoknight)
Fix operator order documentation and add operator associativity (#529)
* Fix Array Subindices operator order + Missing ||
- Array Subincides operator order should be between Unary and Postfix (to be consistent with the compiler's current behavior).
- Add missing || symbol for OR. It could depends on the Markdown parser whether this will work.
* Remove empty list entry
This fixes an error in alternate colorizing the list rows.
* Add associativity to operator order docs
(039763a1 by pietje)
Add support for overriding the id_rsa location
(e8a4cefa by ladycailin)
Add override-post-script to site-deploy
(2940abea by ladycailin)
Update azure-pipelines.yml (e62742cf by ladycailin)
Update azure-pipelines.yml (f3ca081d by ladycailin)
Update azure-pipelines.yml (9382b583 by ladycailin)
Update azure-pipelines.yml (ca6d2f1b by ladycailin)
Update azure-pipelines.yml (e835c36d by ladycailin)
Update azure-pipelines.yml (2a6b3965 by ladycailin)
Update azure-pipelines.yml (ca6b3019 by ladycailin)
Update azure-pipelines.yml (b0c07dfa by ladycailin)
Update azure-pipelines.yml (a2ca5f56 by ladycailin)
Update azure-pipelines.yml (b2fc818a by ladycailin)
Add cmdline support for Windows.
This temporarily removes GUI based support for .ms files,
since that was unreliable. It will be re-added at a later date.
This adds support for a mscript command in cmd.exe, as well as
a PowerShell module, Invoke-MethodScript. The command syntax for
these are slightly different, for the cmdline tools, you must use
the -Tool switch, rather than the -- switch, but otherwise, it is
identical to the unix based system.
(729341f8 by ladycailin)
Add "model" key to item meta to manipualte vanilla's CustomModelData tag for resource packs.
(2066f5c5 by pseudoknight)
Move null check before type check.
(c01443be by pseudoknight)
Fix duplicate branding when MSLog prints messages to screen
(16b5ac50 by pseudoknight)
Log a warning about using Java version above 8 and fix related initial loading errors.
(d492668a by pseudoknight)
Disallow void assignments explicitely, instead of stacktracing
(56b405c3 by ladycailin)
Improve environment cloning on procedure calls.
This moves cloning into execute(), avoids the overhead of cloning the IVariableList, and some other minor improvements.
This also removes a duplicate proc test.
(2ba2eead by pseudoknight)
Fix CVoid check order in IVariable constructor, and create a new constructor for when the value's type does not need to be checked.
This improves performance, particularly with procedure calls, by not performing isInstanceOf() unecessarily, which is slower than it once was.
(627bacc7 by pseudoknight)
Fix convertor intializing before class discovery
(8732754e by pseudoknight)
Comment out broken Mixed argument check for now.
This code doesn't appear to have worked for over seven years and is currently just slowing down script evaluation time, particularly when isInstanceOf() was added in this workhorse section of the code. It might not even be needed, or should possibly be done at compile time only. In any case, we haven't depended on it for several years.
(a61f13c5 by pseudoknight)
Fix array_remove() returning a Java null when an associative array index doesn't exist
(168e2667 by pseudoknight)
Move dynamically registered listeners back to regular listeners for now.
(2a183b54 by pseudoknight)
Do code maintenance on CommandHelper and AliasCore.
A lot of this code was ancient and had built up cruft over the years. So, this cleans up a number of unused or redundant bits of code (especially in AliasCore.alias(), which is heavily rewritten to be more readable and maintainable), moves logging to the plugin logger where appropriate (avoids issues like double tagging in Spigot), and improves line lengths.
(8f68eded by pseudoknight)
Use the plugin logger when possible
(cf219831 by pseudoknight)
Use eval when we don't use the return value
(abfdf9dc by pseudoknight)
Add temporary fix to "Using undefined variable" runtime error message during compile
(7f9d5ad4 by pseudoknight)
Add missing SHEARED spawn reason
(c022369f by pseudoknight)
Fix player event documentation formatting
(9a16aba2 by pseudoknight)
Fix some block_break issues
(e2a8697b by pseudoknight)
Fix refactor mistake "CHLog" -> "MSLog" (#527)
(ebfef602 by pietje)
Fix and update more out-dated documentation
(fde15a9a by pseudoknight)
Build against Spigot 1.14.2
(860b809e by pseudoknight)
Fix ClassCastException when setting potion meta for an arrow in 1.14
(e65233b9 by pseudoknight)
Fix bug in iclosure()
Fix bug in iclosure() returning the wrong type of closure given an empty closure (6cde22d5 by ladycailin)
Update assign(NotAnIvar, ...) error message (#525)
(c66c7267 by pietje)
Loosen restrictions on spawnable entity types with spawn_entity() and fix exception for an invalid hanging spawn location.
(1a11de25 by pseudoknight)
Add SPECTRAL_ARROW to entity_spec and fix arrow/trident handling on 1.14.
Spigot's Arrow class was basically renamed to AbstractArrow, which Arrow, Trident, and SpectralArrow extend. Also, TippedArrow was renamed to Arrow. This makes it tricky to support both 1.13 and 1.14 here, so I've just implemented all the AbstractArrow methods in each entity abstraction class, and no longer extend MCArrow to avoid cast exceptions.
(553b7555 by pseudoknight)
Fix getting Lectern inventory
(45d2d45d by pseudoknight)
Address deprecated BroadcastMessageEvent constructor in 1.14
(97deebd7 by pseudoknight)
Fix site deployment on Windows
(8b6a629e by pseudoknight)
Fix heap_dump() where only hprof file suffix is allowed
(34faf08c by pseudoknight)
Add arrow "damage" to entity_spec
(2dd1e8c0 by pseudoknight)
Update Datahandling docs (#524)
- Fix + extend proc() docs (proc name is not optional).
- Fix closure docs (they take variables, not variable names).
- Use `params` for proc and closure parameters. This is what they actually are and this is consistent with bind(), which calls them custom_params. (2f3ff7cf by pietje)
Replace deprecated entity max health methods
(7bc6e2b3 by pseudoknight)
Add set_keep_spawn_loaded() function for worlds
(c02f6ef4 by pseudoknight)
Update regen_chunk's deprecation and operational status
(d0d4a9d9 by pseudoknight)
Unwrap InvalidProfileException so that it can be caught further up the stack (CMDHELPER-3175)
(73537941 by pseudoknight)
Fix broken links and add missing Prefilters page in documentation
(9a2d06a4 by pseudoknight)
Merge pull request #523 from EngineHub/1.14
1.14 Support (7cbdf86f by michael smith)
Fix a few entity management issues.
- Fix OCELOT and MUSHROOM_COW entity_spec in 1.13.2.
- Add DROWNED to entity_spec, which was already in the docs.
- Clarify the removal of LINGERING_POTION in docs.
(dccb4302 by pseudoknight)
Move control flow functions to ControlFlow class (#521)
Control flow functions were divided over BasicLogic, DataHandling and Echoes. This commit creates one class with all control flow (branching) functions.
- Move control flow functions to ControlFlow.
- Move corresponding test cases to ControlFlowTest.
- Fix 120 character line limit in moved code. (4852ddc0 by pietje)
fix: pom.xml to reduce vulnerabilities (#522)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-MYSQL-174574 (394f88a0 by snyk bot)
Fix foreachelse documentation (#520)
The optional 'key' argument was missing. (19bf62b8 by pietje)
Add new banner pattern: GLOBE
(dbcb5d47 by pseudoknight)
Add foxes and mushroom cows to entity_spec()
(de3d87a4 by pseudoknight)
Fix enabling plugin on 1.13.2 servers
(58020789 by pseudoknight)
Add support for Minecraft 1.14
The following breaking changes exist for all servers:
- Virtual inventories can no longer be larger than 54 in size.
- You can no longer create virtual beacons.
The following breaking changes exist for 1.14 servers only:
- Villager professions have completely changed.
- The "creationradius" and "searchradius" in entity_portal_travel and player_portal_travel have been removed.
- Ocelots can no longer be tamed or sit.
- The following materials are removed but will be converted in legacy item arrays or when using set_block(): CACTUS_GREEN, DANDELION_YELLOW, ROSE_RED, SIGN, WALL_SIGN.
- TIPPED_ARROW and LINGERING_POTION entity types no longer exist and will be converted to ARROW and SPLASH_POTION respectively.
In addition, shoot_projectile() has been rewritten to be more consistent and support almost all entities.
(911deb10 by pseudoknight)
Create UnqualifiedClassName
Elements that are not yet fully defined, but can't be defined yet
can now use UnqualifiedClassName. This can't be used during normal use,
but can be used in the middle of compilation. This solves the bootstrapping
problem that is faced when a class definition extends/implements a class
that hasn't been defined yet, and so thus cannot be fully qualified.
Once the classes have all been initially defined, we can go back through
the list of ObjectDefinitions and call qualifyClasses, which will fully
qualify the previously unqualified class names, and throw an appropriate
exception if any of them are unknown.
Also, rename Objects to ObjectManagement, to match the theme.
(2a849b28 by ladycailin)
Adjust compiler to pass commas through for ObjectDefinitions.
Begin work on ObjectDefinitionKeyword to rewrite classic class
definitions into the functional declaration. Implements keyword is
nearly supported, but only in the happiest path, more test cases are
needed, and certainly there are some currently unsupported cases. The
tests are Ignored for now, since they still fail.
(62eb4e30 by ladycailin)
Support windows newlines in modules file
(9dfbabf5 by ladycailin)
Use a more efficient mechansim for scanning for Functions/Events
Also, use a simpler (but no more efficient) method for loading
jarInfo.ser
(e304652e by ladycailin)
Seriously improve startup time from cmdline
(c43380a6 by ladycailin)
When loading classes from ClassReferenceMirror, use the default CL
Don't use the loader that loaded the CRM class, it doesn't know about
dynamically added extensions.
(21a7103e by ladycailin)
Provide a stopgap measure for isInstanceof CFunction
(c8235b4e by ladycailin)
Provide a stopgap measure for isInstanceof CFunction
(d2063678 by ladycailin)
Cache CompilerEnvironment in AliasCore, and use it in alias()
Additional changes have been made in the core classes, after some
further thinking on the situation.
(b89f8b4a by ladycailin)
Use isInstanceOf everywhere. (#518)
* Use isInstanceOf everywhere.
This changes the code everwhere to use .isInstanceof instead of instanceof, since
this is needed for user objects to work. However, the code is *incredibly* slow,
so much so that RandomTests takes 60 seconds on my computer. I added some caches,
but that didn't really work well enough either. So the next thought is to add this
to the jarInfo perhaps, but even still, once user classes are added,that will increase
startup time even more, so I think this has to be solved in a more general way. I think
the next step is to very closely examine the code path of isInstanceOf, and see what
steps are there today, and figure up if any can be removed, replaced with more efficient
mechanisms, or at least further cached.
This will serve as the basis of the continued work on objects, but until this is fixed,
it utterly kills the runtime performance, and simply cannot be merged in to master.
* Add some caches to speed things up in the course of operation
* Add minor optimization to CClassType
If both compared classes are native, and one extends the other, we can
reliably say it is an instanceof, so just use the native java instanceof
mechanism. This only helps a tiny bit, but it does help, so this will
stay, even though this is not the correct solution.
* Probable fix for slowness.
This commit caches the native class along with the FQCN, which can be used to
seriously speed up the lookup elsewhere, particularly when using instanceof.
The only exception to this is DynamicEnums, but there are so few of those that
it doesn't cause enough of a performance hit. This speeds up RandomTests by an
order of magnitude, but there were other performance increases that should have
helped some as well (though not an order of magnitude.) The end result is that
this should actually be a bit faster than the original code anyways.
* Add better logging when the NoClassDefError is thrown
(3ee1bdf1 by ladycailin)
Add array_push_all, x_find, string_contains_ic.
Also fixed a bug in parse_args, and rewrote string_contains as a
CompositeFunction.
(0b710903 by ladycailin)
Don't use profiles in the standalone environment if they don't exist
(3594c5c4 by ladycailin)
Revert changes in ArgumentValidation.
This proved to have devastating consequences to the performance of
the system, and for the time being, reverting this is the best course
of action. Something downstream of isInstanceOf is taking far too long,
and for a method that would be called extremely frequently, this needs
to be heavily optimized before it can be widely used.
(2d41ef20 by ladycailin)
Don't enumerate types without typeof, just check for typeof.
(f1cd232a by ladycailin)
Include a compiler environment in AliasCore
(d08de403 by ladycailin)
Continue working on Objects
(a1427057 by ladycailin)
CHLog->MSLog
Also make the categories/modules loaded dynamically, instead of
depending entirely on the enum. This now allows categories to be defined
elsewhere in code, including in extensions.
Continue work on Objects as well.
(0515a362 by ladycailin)
Update NewObjects
Add roadmap for inner classes. (756e3c3b by ladycailin)
Continue working on the functional approach to object creation.
define_object and new_object are new functions, which will serve as the
foundation of the object management system. They will not be used
directly, the compiler will support specific syntax sugar for these
methods, but the methods themselves are separated from the compiler.
Currently, defining the class works, (it successfully puts an empty
class into the ObjectDefinitionTable) though most of the rest of the
system works with the NativeTypeList, rather than the
ObjectDefinitionTabble, which is a problem that must be corrected before
most things will recognize user defined classes. new_object does not
work yet, but progress has been made at least. Additionally, FileOptions
has added a copyright and license field, as well as an UltraStrict
compiler option. This will be used in the future to make a super
pedantic mode, and will be used in all native classes to ensure perfect
compliance with all standards. It is not necessarily recommended for
use in user code, but none-the-less will be available and advertised.
(89254c24 by ladycailin)
Object table (#517)
I am going ahead and merging this in to master, as it will be too difficult to manage two different branches for that long. So instead, I am going to do a slow rollout, while making some features available sooner than others, though until the features are all ready, they should not be used, and are subject to complete change. "The features" refers to anything at all related to objects.
* Begin work on creating the ObjectTable object chain.
This will eventually be the underlying mechanism which holds the
defintion of all objects. The first step is to create the structure, the
second step is to be able to fill it in with native classes. There are
several other steps after this to make it useable, but these are the
steps necessary to make it complete.
After it is complete, the next step will probably be to just allow
native types to provide properties, but this will require quite a bit of
work, especially when it comes to ensuring that all the necessary info
is available through annotations, and parameters are all compatible with
Mixed, etc. However, finishing the ObjectTable will be a great first
step.
* Add ObjectHelpers. Support generic parameters in NonInheritsImplements.
Begin work on a POJOConversion framework, which will allow the exposed
methods in a native object to use POJOs, while transparently in the
background, the values are converted to and from Mixed values for use in
user code. This should make the code much easier to write, and much
faster as well. It may also assist in the future if there is a need to
map third party classes into the ecosystem.
* Expand on the object model in the design docs
Also write the design docs for dependency injection.
* Wrote more on topics, write some of the standard library.
Several more sections have been added to the objects design doc, as well
as a small section about manifests and annotations. In addition to this,
a new cmdline tool, new-type has been a... (8fb54faf by ladycailin)
Add "color" to potion item meta
(daf2cabc by pseudoknight)
Bump version of checkstyle
(9bad4e20 by ladycailin)
Update front page with VSC link
(b1264f75 by ladycailin)
Add compile check for unexpected symbols
(02126bc4 by ladycailin)
Add Closure.executeClosure, and deprecate .execute
.execute required the programmer to ensure that the FunctionReturnException was caught,
and if not caught, would cause errors. By default, one does not catch runtime exceptions,
so executeClosure does that, and if one is thrown, returns it as a value.
Additionally, some deprecated code was cleaned up, and a bugfix in site-deploy was made.
(c3628ab5 by ladycailin)
Add exceedingly basic support for annotations. They do nothing yet.
(d776c66e by ladycailin)
Expand further on the UnitTest design doc
(a1b5c5e9 by ladycailin)
Move hypot to use the bundled code paradigm
(33b2902a by ladycailin)
Fix parsing bug for httpVersion in http_request
(eda91d55 by ladycailin)
Revert strict mode change, as it has further reaching impact than expected
(7b8726e9 by ladycailin)
Implement no bare-strings in strict mode.
Additionally, implement a runtime setting to enable strict mode. This is
mostly useful in the interpreter, but can also be used by other code.
(4d9f8bf3 by ladycailin)
Show different colors for restricted functions in api tool
(78c30268 by ladycailin)
Add runtime option that totally disables eval()
(92c2955d by ladycailin)
Remove get_runtime_setting and other minor changes
(ea0363ff by ladycailin)
Add runtime settings.
Primarily, this adds the ability to check and set runtime settings.
Generally speaking, this is a very generic mechanism though, but
currently console and remove_runtime_setting now use this mechanism.
(b6a1b336 by ladycailin)
Add compilerOption file option setup
Currently, AllowAmbiguousCommands is the only option, but if present,
this disables the ambiguous command checking for that script.
In general, it is now also set up so that in the future, more
compilerOptions can easily be added.
(dc1d0373 by ladycailin)
Fix ambiguous alias definition in sample code
(ea32c2a0 by pseudoknight)
Further clarify valid lengths for scoreboards
(7e3cda6b by pseudoknight)
Add functions to manage the player list header and footer
(69b7daf1 by pseudoknight)
Throw a helpful exception when errant new lines are in a persistence key
(410fc3b8 by pseudoknight)
Implement array_index_exists per the specification.
Previously, it only accepted one element, but the documentation stated
that it should support dereferencing multi dimensional arrays. Now the
documented behavior is implemented. Ironically, due to the way the code
functioned, the example showing that code was correct, but for the wrong
reason.
(659a3c28 by ladycailin)
Finish implementing branch statements generically (#516)
Finish implementing branch statements generically
This allows for new functions to define themselves as branch functions in a more precise way, and allows for dead code removal in all cases. (0c174369 by ladycailin)
Add BranchStatement and VariableScope.
Neither of these are used yet, and not all the functions that need to
implement them do. Still to be implemented are (at least) dowhile,
while, foreach, foreachelse, for, proc, closure, (iclosure, rclosure),
and probably some others.
Once all of these functions implement these, then the compiler/runtime
can be modified to start using them. The BranchStatement implementation
will have less impact (none, other than catching user bugs), but the
VariableScope implementation will have a LARGE impact, and needs to be
more carefully implemented. Since many BranchStatements will also be
VariableScopes, it is worth going ahead and implementing that part of
the logic though.
(6e95fcaa by ladycailin)
Highlight @arguments differently in vim (b74c4900 by ladycailin)
anyDoubles now checks for double-like strings
This will eventually be the basis of the doubleish type, but for now this
will apply to everything.
(46f59931 by ladycailin)
Expose prompt_char as a java function
(b24666ba by ladycailin)
Provide a dynamic method to add cmdline tools.
This allows better categorization and organization of cmdline tools,
but most importantly, it allows for extensions to snap in tools. Both
the old and the new mechanism are currently supported, but in the future,
these will all be ported to the new system.
(bb995738 by ladycailin)
Clean up DataSource classes
Also add always_trace, which works like trace, but always shows,
regardless of debug-mode.
(e5ff148a by ladycailin)
Add help command to interpreter, which is like the api cmdline tool
The api tool gave help information about functions, and now this
functionality is available directly within the interpreter. The
documentation itself has also been substantially improved, with support
for removing html tags, doing some wiki formatting, and formatting
tables in a more console friendly way. The underlying code is accessible
publicly through the Interpreter class, and may be used elsewhere in the
future.
(113705d5 by ladycailin)
Add a Booleanish interface. (#514)
Add a Booleanish interface.
This allows objects to specifically declare that, while not booleans
themselves (except CBoolean), they do have a way to convert to a truth
value. This distinction allows functions like if and for to formally
declare that they accept a Booleanish value, but others, will only
accept an actual boolean value. As it stands today, everything accepts
booleanish values, and that is unfortunate, but that will be addressed
when strong typing is added, so that it will reduce most of the errors
that would be runtime.
There are a few other refactorings in this PR, mainly the change from Static.getBoolean to ArgumentValidation.getBoolean. Also added an Iterator class, which functions as the old ArrayAccessIterator, but in a slightly more generic way, working with Iterable objects instead. Iterable is just an amalgam of ArrayAccess and Sizeable, and ArrayAccess no longer extends Sizeable, which now allows for things that don't inherently make sense to be iterable still have array access, without Sizeable. (a00162d9 by ladycailin)
ArrayAccess is not Sizeable
(50fbeb72 by ladycailin)
Grab the modules list from the jar directly
This prevents needing a re-install each time the module list changes,
which I'm sure it will continue to do.
(1d990798 by ladycailin)
Fix missing interface declaration
(a0b8b5c6 by ladycailin)
Add a Booleanish interface.
This allows objects to specifically declare that, while not booleans
themselves (except CBoolean), they do have a way to convert to a truth
value. This distinction allows functions like if and for to formally
declare that they accept a Booleanish value, but others, will only
accept an actual boolean value. As it stands today, everything accepts
booleanish values, and that is unfortunate, but that will be addressed
when strong typing is added, so that it will reduce most of the errors
that would be runtime.
(c4ae56e3 by ladycailin)
Add java.util to the allowed packages
(1f0e10aa by ladycailin)
Update public-suffix data
(4842ccd3 by ladycailin)
Remove references to Main from code that shouldn't actually use it
(ba44e226 by ladycailin)
Native clamp (#513)
Make clamp() work as a composite function
Moving forward, this is the most ideal way to code general purpose
functions that don't specifically require platform support. This should
make these functions portable if the backing engine is changed from
Java to something else, as well as once things like compilation to native
are supported, etc, these will be automatically picked up once the
underlying functions are all supported.
clamp() is a good example of a function for this, as it has no external
dependencies, is purely a math based function, has a simple
implementation, but takes full advantage of the optimization system.
There are also improvements to the ArgumentParser, along with a few bug
fixes in that area.
(8428acab by ladycailin)
Add build-extension tool to cmdline tools
This allows for systems with git and maven installed to quickly and
easily pull down and build extensions. Assuming the extension is
properly set up with git and maven, the only need is to provide the
clone url to the tool. The tool will then git clone the repo, and use
maven to build it, and finally, copy the artifact into the chose
extension directory, defaulting to the current installation's directory.
This commit also fixes a couple of bugs. First, there was a potential
memory leak in CommandExecutor, as well as the fact that it closed
System.out/err. This would, I believe, have minor impact, as only a few
things would have used the buggy modes, but it did affect the
site-deploy tool, as well as shell_adv.
Secondly, when running in Java version 9 or above, every startup would
warn of reflective access. When launching MethodScript with the mscript
shortcut, it now provides the proper command line parameters to suppress
this warning. This would not help when using the jar directly, and
anyways is not a permanent fix, but in the meantime should be less
annoying until Java 9+ is officially supported.
(db7182ab by ladycailin)
Add debug logging to SQLite retry
(0da70ce2 by ladycailin)
Fix and optimize entities_in_radius(), and avoid unnecessary chunk loading.
The chunk radius was off by one and would miss entities on the outside chunks. It would also ignore any entities in the same block location as the center location. Chunks were also being loaded by this and some other functions, causing unexpected performance problems.
(3aaeaed9 by pseudoknight)
Fix seealso path for function docs
(16d1c45e by ladycailin)
Various more fixes for http_request
(c5c30872 by ladycailin)
Support Brotli encoding in http_request
Also allow decompression to be skipped in the options.
Speed up provisional-build by skipping code coverage calculations.
(25a26555 by ladycailin)
Checkstyle fixes.
Also, after further consideration, fixed the bug I just introduced.
(082e0c0a by ladycailin)
Various improvements and bugfixes in http_request
(f35e4da9 by ladycailin)
Possible fix for unit test failures on Travis
(bdbe7d99 by ladycailin)
Add extra logging for diagnostics
(50f46129 by ladycailin)
Add requiredExtensions directive, and implmnt compiler warning for name
(16ec0099 by ladycailin)
Ignore failing unit test while investigation is ongoing
(b6ffd402 by ladycailin)
Docgen updates
Also fixed a bug in FullyQualifiedClassName that affected vim syntax highlighter
generation, and added unit tests for that.
(b20d8708 by ladycailin)
Rename public-suffix.txt->dat
(cb84d45d by ladycailin)
Update Permissions_Settings (d650aae7 by ladycailin)
Update public-suffix.txt.
Also, created a mscript to simplify doing this in the future.
(4c327a28 by ladycailin)
Add x_write, for cmdline use only
(165f16f0 by ladycailin)
Fix reflect_pull() for dynamic enums (#512)
(0a7f9d6b by michael smith)
Correctly handle SOE in includes.
Also, add more detailed information to the profiler message for include,
and add includes to the stacktrace.
(4189a598 by ladycailin)
Re-wrap SOE in closure's execute also
(8f3478ad by ladycailin)
Re-wrap SOE and use CRESOE, so we get more useful errors
and can generally support this in the exception system. This might need
to be added to the execute method as well.
(39e5f225 by ladycailin)
Fix site-deploy
Now, in addition to fixing the actual issue (in a way that that won't happen again),
we now also print out usable error messages. For whatever reason, Logger was not
working, so instead of fixing that, it has simply been removed, and made to work with
the existing paradigm anyways. This should make it easier to diagnose errors within
the documentation itself in the future.
(48e260d8 by ladycailin)
Properly pass column information through the exception system
Previously, the causedBy section of the exceptions were not properly
printed in the default unhandled exception handler. Now, the column
information that is passed through is properly printed (though I think
the column information itself is still not accurate, but this is a
problem in the compiler, not the exception system). Also added "at" to
the beginning of each stack trace line, which brings the format more in
line with other languages stacktrace prints.
(06fe308a by ladycailin)
Add ValueType semantics
This allows objects to mark themselves as value types. Currently, all
primitives are marked as such. In the future, the compiler may be able
to further optimize these types, particularly if true compilation is
added. For now, this is unused, and the compiler treats everything as
pass by reference, but this is not ideal. At least going forward now,
the ValueType class is established, and other classes can go ahead and
start marking themselves as such. Eventually, this mechanism can
probably be exposed to user classes, but for now it is internal only.
(b24b6dc4 by ladycailin)
Fix compiler bug when dealing with bad breaks
Previously, when using the break(1) format, if the integer wasn't
atomic, then this would cause a java stack trace. Now it causes a normal
compile error.
(bae58755 by ladycailin)
Add a more helpful error message
(2c40de74 by ladycailin)
Catch Error too
This allows us to always (at least attempt) to print an error message.
While OOME will still leave us in a precarious state, we should at
least attempt to print out a helpful error message.
(5128f80d by ladycailin)
Construct to mixed2018 (#511)
This set of changes completes the goals of the original construct-to-mixed branch. Function unfortunately worked with Constructs, rather than the Mixed interface. This was a violation of the Dependency Inversion Principal, which has prevented several critical improvements to the language. The problem is that in Java, there is not multiple inheritance, so while normal classes could easily extend Construct and then be added into the ecosystem, for other types of classes, where it's impossible to extend Construct (particularly because they are already extending another class, which is true in at least the cases of enums and exceptions), these objects simply could not be added into the ecosystem.
Now, everything accepts and for the most part deals with Mixed, which is an interface. This has the unfortunate side effect of breaking binary compatibility with extensions, but this change has been in the works for at least three years. As part of this change, implementing enums was used as a test case. That has now also been done, and barring a few bugs, seems to mostly work. This allows access of enums as first class objects, rather than as arrays of strings as previously implemented through reflect_pull.
The PR opens lots of possibilities in the future, and so is a welcome change to the base, but there are a few short term goals after this PR is merged:
* Move exceptions into first class status. Currently they are implemented as arrays, but this is a shoehorn and not ideal.
* Write up documentation for Enums. There is some documentation already available, and this may be mostly correct, but it should at least be read through to ensure it is correct, and then linked to the learning trail. It's also possible to iterate enums with foreach, and so this should be added as an example in various places.
* There are still a few bugs with enums, particularly it is not possible to assign an enum class to a variable. ClassType @s = ArraySor... (4964181d by ladycailin)
Add NativeObjectArchitecture design doc
This is in conflict with the NewObjects design doc, and these conflicts
need to be thought through and one or the other changed. My current
thinking is to use the style defined in the NativeObjectArchitecture
doc, but I need to think more on this.
(6cb2e611 by ladycailin)
Refine cross casting docs
(9fc3c9eb by ladycailin)
Add glob matching to VirtualGlob, and enable unit tests
(eab485ef by ladycailin)
Make test code handle null from thrown
Fix test failure in uuid()
(3cc5250e by ladycailin)
Expanded the funcionality of uuid.
The default behavior is the same, but now it takes a type parameter,
which currently only supports NIL and RANDOM, but will be expanded later
to support all 5 versions of UUIDs. The documentation is more detailed,
and there are examples now, and it is set up to easily return the other
types of UUIDs later.
(38944856 by ladycailin)
Add uuid() to generate uuids
(dd81cf48 by ladycailin)
Support tridents for shoot_projectile() and entity_spec()
(9952089c by pseudoknight)
Fix incrementing/decrementing doubles in arrays
(43b2850e by pseudoknight)
Merge branch 'master' of github.com:EngineHub/CommandHelper
(f5842d62 by ladycailin)
Ignore some failing tests
(5b1f3bca by ladycailin)
Merge branch 'master' of github.com:EngineHub/CommandHelper
(5453b915 by ladycailin)
Continue working on VFS.
Add more comments and unit tests, though everything is disabled for now,
since it's not usable in code yet, and most things don't work. I have
identified the tests that need to pass for a minimally viable product,
so once those are completed, I will integrate the system into MS proper.
(714e64a0 by ladycailin)
Update azure-pipelines.yml (9e883eaa by ladycailin)
Set up CI with Azure Pipelines (4a2e6d35 by ladycailin)
Move subset out of intersect
(e84f4299 by ladycailin)
Re-add array_subset_of, which disappeared somehow
(52dd0c47 by ladycailin)
Merge branch 'master' of github.com:EngineHub/commandhelper
(8f7d354d by ladycailin)
Add "color" to scoreboard teams
(3fbde6f6 by pseudoknight)
Add get_entity_riders() and clarify behavior of rider functions.
Also fix core error when horse and rider are identical in set_entity_rider().
(27124a46 by pseudoknight)
Fix ponline() when given a UUID
(e1fabec4 by pseudoknight)
Fix item_pre_craft event
(e88b4400 by pseudoknight)
Merge branch 'master' of github.com:EngineHub/CommandHelper
(de97884e by ladycailin)
Add additional example with duplicate values
(a7e17987 by ladycailin)
Merge pull request #507 from jb-aero/recipes
Add functions for managing the Villager-style trading system. (afe88730 by jb_aero)
Throw exception when trying to reuse ID
(491c18c9 by jb-aero)
merchant_trading -> merchant_trader
(6a594f1b by jb-aero)
Remove trade storage and recipe format reliance.
(b8996e97 by jb-aero)
Add merchant_trading check function.
(754381a8 by jb-aero)
Establish Trades class of functions
(11110b59 by jb-aero)
Add get_merchant_recipes and make extra settings of merchant recipes optional
(0df4eb1e by jb-aero)
Add abstraction for merchant recipes.
(e67bc0eb by jb-aero)
Add array_intersect, and others
Also added a default hashCode method to Construct, (as well as a very
thin hash() method that wraps that), which is used by array_intersect.
ArgumentValidation.getEnum is added as well. A -e option has been added
to the api command in the cmdline tools, which displays the examples for
a function. CArray now implements Iterable, but throws an exception for
associative arrays, as that doesn't make as much sense to happen.
(81952474 by ladycailin)
Support sprintf in Java 9.
Also checkstyle fixes.
(485e430c by ladycailin)
Implement keySet in CString, and others
Use ArrayAccess in array_implode, to allow strings (and other Array-like
objects) to be imploded. Support CClassType in array_sort. Move mixed to
ms.lang namespace.
(430960a0 by ladycailin)
Add namespace support for native types
For the time being, there is no mechanism to add user classes,
or even using() statements, but now at least the mechanism is
fully defined, and the fully qualified class types are displayed
and internally tracked. The syntax for now is :: as the separator,
but it will probably change to . after some discussion and a
deprecation period. ms.lang and com.commandhelper are default
namespaces, and do not need to be specified, and in fact, at this
time cannot be specified, as there is currently no supported way
in code to fully qualify a class type. com.commandhelper will
eventually be removed once the CH functionality is split out, but
will be extensible by the embedding program, so will be added
back in specifically for CH scripts.
Before . can be used as the path separator, there needs to be a
deprecation period, for non-strict mode users, they could potentially
be concatenating bare strings, and that would interfere with this
mechanism, so this "feature" must be removed.
(dd1ed43f by ladycailin)
Merge branch 'master' of github.com:EngineHub/commandhelper
(867e0716 by ladycailin)
Update Cross_Casting
Documentation update (391a19cc by ladycailin)
Merge pull request #502 from Pieter12345/1.13-dev
Add sender type to server_command event (eb502a1e by michael smith)
Change server_command sender type "type" -> "sendertype"
This is a change for the previous commit.
(2411a0e9 by pieter12345)
Add sender type to server_command event
Add sender type to the server_command event. This can be one of: console, command_block, command_minecart of null when CommandHelper does not know the command sender implementation.
(0d5b5271 by pieter12345)
Fix modifying item in item_pickup
(52c69d40 by pseudoknight)
Support blockdata strings in psend_block_change()
(2c9f48a5 by pseudoknight)
Merge pull request #505 from EntryPointKR/master
Fix non include file encoding to UTF-8 (67779b53 by ladycailin)
Fix not include file encoding to UTF-8
(6546bd98 by limjunhyeong)
Fix enum lists in event documentation due to formatting issue
(ddefc886 by pseudoknight)
Address some deprecations
(0b87a48f by pseudoknight)
Update documentation for Minecraft functions
(649b753d by pseudoknight)
Add keyword support to reflect_pull
(75dc6d0f by ladycailin)
Remove substance, update public suffix
(696d76b8 by ladycailin)
Ignore empty skull owner strings
(c6dcf7e3 by pseudoknight)
Merge pull request #503 from Pieter12345/master
Fix get_server_info and world_info documentation (dfce8d06 by michael smith)
Fix get_server_info and world_info documentation
- Allow flight disables (not enables) the anti-flight.
- Add missing maxHeight key.
(d56085ab by pieter12345)
Fix getting the id of certain virtual inventory types.
This is due to a recent change in how Bukkit handles creating certain inventory types like Hoppers. Bukkit now ignores any holder you pass in for these types, returning null if you retrieve the holder from these inventory objects.
(76145824 by pseudoknight)
Modernize syntax in advanced scripts page
(66cd5102 by pseudoknight)
Update Compatibility page
(c87a1d3a by pseudoknight)
Merge branch '1.13-dev' of https://github.com/EngineHub/CommandHelper
(7277e87c by pseudoknight)
Add changelog for 3.3.2
(68bedf15 by pseudoknight)
Merge pull request #500 from Pieter12345/1.13-dev
Handle block-specific trait exceptions in material_info (eb709da6 by michael smith)
Handle block-specific trait exceptions in material_info
The hardness and blastResistance traits are unavailable for non-block materials (such as REDSTONE), causing material_info('REDSTONE') to throw an error in core. This commit no longer returns these traits for non-block materials and throws a CREIllegalArgumentException when these traits are specifically asked for on non-block materials.
(7ae28a70 by pieter12345)
Fallback to a modern material name on legacy item conversion.
If a script incorrectly uses a modern material name with a data value, we should still try and correct for that.
(18205c10 by pseudoknight)
Partially revert item meta enchantments array changes. It is now an array of arrays again, but the new enchantment keys still exist.
This should improve compatibility a bit with legacy scripts reading new enchanted item meta arrays, as well as future proof for possible enchantment data additions.
(03e94bfb by pseudoknight)
Remove deprecated and broken "block" key in entity_enter_portal event
(568e8cd1 by pseudoknight)
Return associative array of teams for scoreboards
(aa81d3a3 by pseudoknight)
Documentation corrections
(3794a57b by pseudoknight)
Sync registered commands once when one or more commands are added or removed
(87fdb9af by pseudoknight)
Remove some unneeded reflection
(88dbe5f2 by pseudoknight)
Add fallback for getting shield basecolor
(bd2a6a20 by pseudoknight)
Build against Bukkit 1.13.1
(7c14e6a1 by pseudoknight)
Fix get_recipes_for() name and boilerplate error
(27498a64 by pseudoknight)
Address some deprecations
(a43155ce by pseudoknight)
BREAKING CHANGE: Move item damage from the "data" key to the "damage" key in the item meta.
This also fixes damage on items with meta.
(52753f57 by pseudoknight)
Better handle legacy potion data and item conversion
(3283090a by pseudoknight)
Address a couple shield and banner meta issues.
Notably there's a spigot bug with shield specific meta that prevents us from getting and setting colors and patterns. This makes it fail gracefully without destroying all meta on the item. This also fixes a missing color conversion for silver banners.
(6ed53589 by pseudoknight)
Properly throw an exception when set_entity_spec() is given an invalid material
(63a411b2 by pseudoknight)
Update list of commands for players and commandblocks upon register_command()
(36ee1339 by pseudoknight)
Handle null item arguments in certain inventory functions
(a42c09c9 by pseudoknight)
Fix unregister_command()
(20de1284 by pseudoknight)
Fix commandblock functions
(d1678aa4 by pseudoknight)
Add potion effect type names and modify the potion effect array to reflect this.
This probably won't break any existing scripts that read or write potion effects, but it is possible.
(18868348 by pseudoknight)
Clean up some deprecations
(6e10805e by pseudoknight)
Also accept material names as ingredients in recipes
(a34b3aff by pseudoknight)
Add optional ban reason and source to set_pbanned()
(4f70fba6 by pseudoknight)
Add functions to check and set whether other entities will collide with a mob
(60b5c7e8 by pseudoknight)
Merge branch 'master' of https://github.com/EngineHub/CommandHelper into 1.13-dev
(0e030eea by pseudoknight)
Fix core error when reflect_docs() is given one argument
(06064422 by pseudoknight)
Don't report a compile exception for a missing function before linking (fixes function_exists() and extension_exists() in many cases)
(5a470cdd by pseudoknight)
Convert entity types that don't match spawn egg material names
(3edc300f by pseudoknight)
Update spawn_entity() docs and hide spawn_mob()
(62f70c46 by pseudoknight)
Add Tropical Fish entity_spec() and bucket item meta
(31bf10f5 by pseudoknight)
Make BadEntityException message formatting consistent
(45b113da by pseudoknight)
Do compile time check for valid sounds on our own list
(fe32b4f5 by pseudoknight)
Document likely scoreboard string length limits
(73a1ee7b by pseudoknight)
Add compile time warning when using an invalid Effect in make_effect()
(f8bf56c0 by pseudoknight)
Convert legacy spawnegg meta to new item types
(e450ce66 by pseudoknight)
Make MainHand and OffHand methods consistent
(035360ab by pseudoknight)
Add 3.3.3 entry to directory page
(e1fd3954 by ladycailin)
Remove redundant player insertion in event data
(28a0dfc3 by pseudoknight)
Replace deprecated Bukkit event with equivalent
(6d40298d by pseudoknight)
Support spaces in old enchantment functions just like before, and depecrate can_enchant_target() for can_enchant_item()
(fde172fe by pseudoknight)
Update enchantment arrays in item meta arrays to be associative, and update a few enchantment functions.
Old enchantment arrays will still be accepted and applied to the item. The functions enchant_inv(), enchant_rm_inv(), and get_enchant_inv() have been deprecated for enchant_item(), remove_item_enchant() and get_item_enchants() respectively. The sandbox function enchant_inv_unsafe() has been removed due to obsolescence.
(90a38b5d by pseudoknight)
Remove deprecated player_prelogin event and fix player_login prefilter
(9422e902 by pseudoknight)
Prioritise item conversion for anvils
(ea2d406d by pseudoknight)
Re-add get|set_mob_target()
(1a6b478b by pseudoknight)
Remove tab_complete_chat event (non-functional)
(a348de6d by pseudoknight)
BREAKING CHANGE: Change SILVER to LIGHT_GRAY for consistency.
Banner meta for items will be automatically converted, but hard-coded strings of 'SILVER' should be replaced with 'LIGHT_GRAY' when setting sheep, shulker, or wolf collar colors.
(81c86b9d by pseudoknight)
Fix NPE when given invalid material ids
(a81a6599 by pseudoknight)
Fix incorrect arg limit
(be5dcd63 by pseudoknight)
Add "hardness" and "blastResistance" to material_info()
(e76a76e8 by pseudoknight)
Further improve legacy material handling
(12ee67ab by pseudoknight)
Improve legacy item conversion
(709e98ee by pseudoknight)
Also try converting legacy material names in data_name()
(e11b715a by pseudoknight)
Better handle air in player_interact
(6944aba6 by pseudoknight)
Re-add data_name() and data_values() for now.
The data_values() function is deprecated, and data_name() returns the modern material name for old values passed in for conversion purposes.
(74887227 by pseudoknight)
Convert changed Bukkit DyeColor
(04a88163 by pseudoknight)
Fix NPE in player_interact when clicking nothing
(2af196cc by pseudoknight)
Add map meta key "mapid"
(6a8a2336 by pseudoknight)
Update Sounds to match new names
(0ccb9633 by pseudoknight)
Add spawn_particle() function
(6b266fc5 by pseudoknight)
Add closure parameter to spawn_entity() to apply entity attributes before being added to the world
(86d1e750 by pseudoknight)
BREAKING CHANGES: Update to reflect changes in 1.13 to items and blocks.
It is highly recommended that you do not run this on a production server running pre-1.13 scripts. While efforts were made to warn and convert where necessary, there will be problems with scripts handling items or blocks! Here is a summary of most of the changes:
Numerical material ids and data values have been removed in Minecraft. This requires a significant number of changes to any functions or events that handle items or blocks. Though old inputs should continue to work for the most part, deprecation warnings have been inserted when converting from old values, as these are no longer guaranteed to have perfect conversion. Most affected "get" functions and event data output the new material names, so it's impossible to automatically detect all places scripts need to be updated. Saved item arrays will still work in all functions, but a convert_legacy_item() function has been provided to better guarantee conversion accuracy for certain old materials with name conflicts. (eg. MELON) A key "isInteractable" has been added to material_info().
In the item array output, the "type" key and the redundant "enchants" key were removed.
The following functions were removed: data_values() and data_name().
The following functions were deprecated completely: set_block_at() and get_block_at().
The following functions were added: get_blockdata_string(), set_blockdata_string(), and convert_legacy_item()
The following functions' inputs and/or outputs may be affected: can_enchant_target(), get_enchants(), entity_spec() and set_entity_spec() for enderman and minecart blocks, phas_item(), pitem_slot(), pgive_item(), ptake_item(), pgive_enderchest_item(), ptake_enderchest_item(), add_to_inventory(), take_from_inventory(), max_stack_size(), material_info(), entity_line_of_sight() and pcursor() (transparent block array), pinfo(), psend_block_change(), and spawn_falling_block(). (not including any item array ... (03f9d187 by pseudoknight)
Add recipe "key" for furnace recipes
(f6fcd5ba by pseudoknight)
Fix geshi syntax highlighter function URLs
(ba68da70 by pseudoknight)
Add warning for deprecated tame_mob()
(6c566d71 by pseudoknight)
Add "icon" parameter to potion effects (and fix missing "particles" key in potion meta)
(ff30bd06 by pseudoknight)
BREAKING CHANGE: Update biome types (affects get|set_biome())
(26b2c61b by pseudoknight)
BREAKING CHANGE: Update painting (art) types
(b8dd6667 by pseudoknight)
Handle plugin channel name requirements
(fd8a8a42 by pseudoknight)
Add new particle types: SQUID_INK, BUBBLE_POP, CURRENT_DOWN, BUBBLE_COLUMN_UP, NAUTILUS, DOLPHIN
(68499452 by pseudoknight)
Fix missing skull owner key check
(5dc11178 by pseudoknight)
Fix "docs" commandline tool output
(dedc23dc by pseudoknight)
Fix CommandHelper loading
(c89ca551 by pseudoknight)
Merge pull request #498 from Pieter12345/master
Fix set_uncaught_exception_handler closure return behaviour (eb2deab5 by ladycailin)
Make HandleUncaughtException method no longer throw for FATAL result
- Make HandleUncaughtException(ConfigRuntimeException e, Environment env, Reaction r) no longer throw an exception when Reaction is FATAL. Instead, handle it the same as REPORT.
- Revert return value change from FATAL to REPORT in GetRaction(...).
(8f6aea50 by pieter12345)
CheckStyle: Fix violations
Fix CheckStyle violations so that CommandHelper builds again.
(f9e7a075 by pieter12345)
Fix set_uncaught_exception_handler closure return behaviour
Before this commit, the return value of the closure passed to set_uncaught_exception_handler would result in:
- true -> Suppress exception.
- null -> Use default uncaught exception handler.
- false -> Use default uncaught exception handler and print the java stacktrace to the cause.
- exception in closure -> Use default uncaught exception handler for the exception in the closure and suppress the first exception.
The behaviour set by this commit is:
- true -> Suppress exception.
- null -> Use default uncaught exception handler.
- false -> Use default uncaught exception handler.
- exception in closure -> Use default uncaught exception handler to print both exceptions.
This new behaviour matches the documentation of set_uncaught_exception_handler.
(39dc2c27 by pieter12345)
Fix possible mistake
This change should be obvious when looking at the code, considering the "name" variable was unused. This might prevent a NullPointerException in some cases.
(ab3587c3 by pieter12345)
Ignore Metrics in checkstyle
(992c273d by ladycailin)
Fix checkstyle errors, s/bstats/mcstats
(18380b5d by ladycailin)
Merge pull request #496 from EngineHub/csharp
Csharp (3e62af93 by ladycailin)
Merge branch 'master' into csharp (7d3b00f5 by ladycailin)
Remove "owneruuid" key for skull meta. This never worked well. Server implementation needs to be fixed.
(6660fa44 by pseudoknight)
Skip checkstyle on provisional builds
(2b107bd6 by pseudoknight)
Fix CH loading on server versions prior to MC 1.12
(2e28bfa8 by pseudoknight)
Merge pull request #495 from Pieter12345/player_move_event_bugfix
BugFix: Fix unbinding player_move to unbind multiple player_move events (8a87e0c1 by michael smith)
BugFix: Fix unbinding player_move to unbind multiple player_move events if no threshold prefilter is supplied
When binding multiple player_move events without threshold prefilter and then unbinding one of those events, all events would not trigger anymore until another event with the default treshold prefilter would be bound. This bug is caused by the unbind code removing the default threshold without checking whether more events still use it.
(ccffaa9f by pieter12345)
Improve matching for dynamic Enums
(1fecd284 by pseudoknight)
Add LLAMA_SPIT and SHULKER_BULLET to projectile types
(f93d2757 by pseudoknight)
Support all living entity type names in spawn_mob(). (CMDHELPER-2894)
spawn_mob(entity_type(@uuid)) should always work now, as long as the entity type is living.
(7402c5c2 by pseudoknight)
Merge pull request #494 from PseudoKnight/master
Add new inventory functions and virtual inventories. (9fdbe02e by michael smith)
Add new inventory functions and virtual inventories.
New functions: popen_inventory(), pinventory_holder(), get_inventory_viewers(), get_virtual_inventories(), create_virtual_inventory(), and delete_virtual_inventory().
New "virtual" prefilter for inventory_click, inventory_drag, inventory_open, and inventory_close events.
New inventory "holder" data for inventory_open and inventory_close events.
(90ddb51c by pseudoknight)
Merge pull request #493 from Pieter12345/mismatched-paren-feedback
Improve code target for mismatched parens (9fdb6fec by ladycailin)
Improve code target for mismatched parens
Change the code target to the last opening '({[' that does not have a closing ')}]', instead of always returning the last line of the script for such CRE's.
(b2f8bab8 by pieter12345)
Merge pull request #492 from Pieter12345/broadcast-function-event
Fix broadcast() function event consistency (33616632 by ladycailin)
Fix BukkitMCServer broadcast behaviour + Update broadcast() docs
- Remove usage of Server.broadcastMessage(...) methods since they also broadcast to all active command blocks in-game, effectively setting their last output value in their GUI.
- Broadcast to console unless a recipients set is supplied without the console command sender in it.
- Update broadcast() documentation to match the changes.
- Add javadocs to MCServer to describe the broadcastMessage(...) behaviour that implementations should follow.
(5097011b by pieter12345)
Add broadcast(message, array) console support
- Add broadcast(message, array('~console', ...)) support to target the console.
- Include broadcast to console behaviour in the documentation.
(071371d3 by pieter12345)
Make broadcast() trigger events consistently + Extend broadcast() docs
- Make broadcast(message, players) fire an event through its Bukkit implementation so that it matches the broadcast(message) and broadcast(message, permission) behaviour.
- Extend broadcast() documentation to include all behaviour.
(436a1fb9 by pieter12345)
CheckStyle: Fix IDE compatibility + gitignore
- Fix Eclipse's (and according to Google IntelliJ's) CheckStyle plugins failing on finding the checkstyle_suppressions.xml file. This change does not affect Maven builds.
- Add .checkstyle to the git ignore file.
(401d4c22 by pieter12345)
Remove some deprecations
(8f94455e by pseudoknight)
Add ENDER_EYE to entity_spec()
(a278c72f by pseudoknight)
Merge pull request #491 from Pieter12345/randomtest-optimization
Disable secure_string and get_locales boilerplate test (bdb29c3e by michael smith)
Disable secure_string and get_locales boilerplate test
Disable secure_string and get_locales boilerplate test because these slow down the build time by Travis CI significantly. secure_string's boilerplate test can easily take 6 minutes and even cause Travis CI to time out (>10 minutes combined).
(dacb0741 by pieter12345)
Merge pull request #489 from Pieter12345/randomtest-optimization
RandomTest optimization (950ccc3c by ladycailin)
RandomTest optimization
- Optimize `testFunctionsAreOnlyDefinedOnce` test to run in O(n) instead of O(n^2) where n = 743 (and n^2 = 552049). Locally, this reduces the test time of te RandomTests class (being 12±2 seconds on my system) by roughly 3 or 4 seconds on my system.
- Fixed javadoc comment.
- Fixed case where not setting up the global environment makes the `testFunctionsAreOnlyDefinedOnce` test fail when executed on itself in an IDE.
(4fba2786 by pieter12345)
Update entity_spec()
- Add DRAGON_FIREBALL direction
- Fix SMALL_FIREBALL
- Add block and offset to all minecarts
- Update wrapper classes
(d79972e1 by pseudoknight)
Merge pull request #485 from Pieter12345/checkstyle3
CheckStyle: Add more rules (0925e6bc by michael smith)
CheckStyle: Fix or suppress remaining violations
Fixing public name violations might cause incompatibility with dependents (e.g. CH extensions and plugins depending on CH). Therefore, ignoring the current violations and ensuring it does not get worse is a safe choice for now.
(d02e642f by pieter12345)
CheckStyle: Update rule set
- Remove HideUtilityClassConstructor check. Fixing these violations would require adding ~104 empty private constructors to hide default constructors. This should not be forced upon contributors.
- Ignore MethodName check. Changing public method names will break any extensions that uses them. This should not be done without deprecating all violating methods first.
- Remove MissingCtor check. This would require adding ~1100 empty constructors to not directly rely on the default one. This should not be forced upon contributors and does not make the code more clear.
- Change whitespace check for "try", which now enforces whitespace usage "try(" and "try {".
- Disable "SuperClone" and "SuperFinalize" check. These checks even require to call super.clone() and super.finalize() when their class extends directly from Object, in which case adding them is pointless and at most distracting.
- Fix whitespace check for between if/for/while and their '('.
(333e0097 by pieter12345)
CheckStyle: Fix name violations
(065ca39e by pieter12345)
CheckStyle: Fix MultipleVariableDeclarations violations
(fc08e991 by pieter12345)
CheckStyle: Fix FinalClass violations
(aaf0798f by pieter12345)
CheckStyle: Fix whitespace violations
(bbbfaf6f by pieter12345)
CheckStyle: Fix ModifierOrder violations
(4421fe88 by pieter12345)
CheckStyle: Fix whitespace and EmptyStatement violations
(bb96a7ea by pieter12345)
CheckStyle: Fix EmptyStatement violations
(3c71b692 by pieter12345)
CheckStyle: Suppress FallThrough violation
Fallthrough is efficiently used here, so suppress the violation.
(8f3c5f39 by pieter12345)
CheckStyle: Enable SuppressWarnings annotation
Allow @SuppressWarnings("checkstyle:<CHECK>") to suppress checkstyle violations.
(7fd0a514 by pieter12345)
Revert "CheckStyle: Remove FallThrough"
This reverts commit ff0ccaec66489586a46386957b301653eeeb02f4.
(041c0de9 by pieter12345)
CheckStyle: Fix merge violations
Fix all introduced checkstyle violations in the last merge.
(d399ba5d by pieter12345)
Merge branch 'master' of https://github.com/EngineHub/CommandHelper into checkstyle3
(60f75f85 by pieter12345)
CheckStyle: Fix 41 OverloadMethodsDeclarationOrderCheck violations
Fix 41 OverloadMethodsDeclarationOrderCheck checkstyle violations. This is just changing method order.
(62189af8 by pieter12345)
CheckStyle: Fix 1372 try/catch whitespace violations
- Fix 1362 checkstyle violations where 'catch' is not followed by a whitespace.
- Fix 10 checkstyle violations where 'try' is not followed by a whitespace.
(03bfc16b by pieter12345)
CheckStyle: Fix 301 if/for/while whitespace violations.
Fix 301 whitespace violations where one or multiple whitespace characters exist between an if/for/while and its corresponding '('.
(7d60e35b by pieter12345)
CheckStyle: Fix missing continue in switchcase violation
This rule is no longer in the CheckStyle set, but in this place in the code, fallthrough is not necessary and increases the chance of future mistakes being made.
(527edcaf by pieter12345)
BugFix: Fix escaped characters in file options ending the file options
- Any escaped character other than '\>' would be recognised as FILE_OPTIONS_END ('>') due to a missing break.
- Code rewrite so it no longer relies on a while(true) where it does not have to.
(e10990ec by pieter12345)
BugFix: Fix expected CRE not being thrown when setting block dispense item to AIR
Fix expected CRE not being thrown when setting block dispense item to AIR due to using a ref-equals on a String literal.
(94835690 by pieter12345)
CheckStyle: Fix mistake
Fix a copy-paste mistake.
(aa289d19 by pieter12345)
CheckStyle: Remove FallThrough
Fallthrough can be useful and should be allowed for that reason.
(ff0ccaec by pieter12345)
CheckStyle: Add more rules
A CheckStyle configuration which will ensure more consistent sourcecode in the future.
(3a7d49db by pieter12345)
Merge pull request #486 from Ecconia/Fix-Playerinsertion-JoinEvent
JoinEvent inject Entity (78f10856 by michael smith)
JoinEvent inject Entity
The function "set_metadata" and similar require an entity to be online.
The entity (player) is known by the event already, but not the rest of the server.
Injecting it, to make it accessible. (1a703a24 by ecconia)
Ignore queue interruptions during reload
(ca72bc5c by pseudoknight)
Add boat "type" to entity_spec()
(4924b5d8 by pseudoknight)
Add "source" for EVOKER_FANGS in entity_spec() and make them spawnable
(fbd63c09 by pseudoknight)
Fix FALLING_BLOCK in entity_spec() and add "damage" boolean
(377fc5fd by pseudoknight)
Add pvelocity() to documentation
(69483e77 by pseudoknight)
Add shulker color to entity_spec()
(77387973 by pseudoknight)
Fix typos and missing block in data_names.txt
(b802db5c by pseudoknight)
Update entity wrapper classes
(fb12c5cd by pseudoknight)
Fix core error when given an invalid potion type (CMDHELPER-3172)
(88a131aa by pseudoknight)
Merge pull request #484 from Pieter12345/checkstyle2
Checkstyle update (6cb2fb34 by ladycailin)
CheckStyle: Add suppression filter for star imports in test classes.
Added a suppression filter that effectively allows star imports in test classes.
(baa509a9 by pieter12345)
Move checkstyle execution to test phase
- Moved the checkstyle execution from the validate phase to the test phase.
- Renamed the maven plugin execution to "checkstyle".
(4c220e17 by pieter12345)
Merge pull request #483 from Pieter12345/checkstyle
Checkstyle (b4993e81 by ladycailin)
Added checkstyle parenthesis padding check.
Disallow whitespaces after '(' anf before ')'.
(79612550 by pieter12345)
Removed checkstyle empty block check.
- Removed EmptyBlock checkstyle check since it triggered for cases where it is not necessarily bad.
- Removed several empty blocks where they were not necessary.
(f4889ab6 by pieter12345)
Formatting: Replaced star imports.
Replaced star imports with the actually used imports.
(726aac86 by pieter12345)
Formatting: Removed trailing whitespaces/tabs.
Removed trailing whitespaces and tabs.
(68d33268 by pieter12345)
Formatting: Disallow whitespaces.
- Replaced leading 4-wide whitespaces with tabs.
- Removed/replaced remaining leading whitespaces to maintain consistency.
- Added *'s to multiline docs where they were missing.
(232db3a2 by pieter12345)
Added checkstyle.
- Added maven's checkstyle plugin (applies to main and test .java files).
- Added a check for line length <= 120 (currently marked as ignored due to >7000 violations).
- Disallow whitespace indents (force TABs).
- Disallow star imports (import blabla.*).
- Disallow empty blocks ({}).
- Disallow trailing whitespaces/tabs.
(d74d3159 by pieter12345)
Formatting: pom.xml
Made Tab/whitespace usage consistent.
(6c607f22 by pieter12345)
Change a few uses of math to TimeConversionUtil
(95670d2b by ladycailin)
Merge branch 'master' of me.github.com:EngineHub/CommandHelper
(dc1c6887 by ladycailin)
Add TimeConversionUtil class
(3dec134a by ladycailin)
Dynamically register broadcast_message if it exists
(f3dd494d by pseudoknight)
Added broadcast_message event.
Added support for Bukkit's BroadcastMessageEvent.
(09684e16 by pieter12345)
Removed unused fields.
If this is necessary for anything in the future, the reference can be obtained through BukkitMCWorldEvent.
(86d4f785 by pieter12345)
Moved server events to their own class.
Moved BukkitMCServerCommandEvent and BukkitMCServerPingEvent from BukkitMiscEvents to BukkitServerEvents.
(86c05b36 by pieter12345)
Add "delay" meta for MOB_SPAWNER
(314146eb by pseudoknight)
Use locationArray more consistently in function docs
(a09855f4 by pseudoknight)
Improve executeas() test
(0f38f19a by pseudoknight)
Fix "See more..." links in documentation
(eeceb294 by pseudoknight)
Add executeas() to change player/label context when running a closure
(c5b87afe by pseudoknight)
Add player prefilter for item_held event
(bcf6ac35 by pseudoknight)
Update mysql shade pattern
(04343125 by pseudoknight)
Merge pull request #480 from Pieter12345/lexer_minus_fix
Fixed invalid minus sign interpretation. (d2490dff by ladycailin)
Unit tests for '+' lexer handling.
Added unit tests for '+' sign absorbtion.
(b3f6bec8 by pieter12345)
Extra unit tests for '-' lexer handling.
Added extra tests.
(90aae5ff by pieter12345)
Fixed invalid minus sign interpretation.
Bug examples:
array(5)[0] - 3 would become 2, but array(5)[0] -3 would become string '5 -3'.
2 - 3, 2-3 and 2- 3 would become -1, but 2 -3 and 2 -3 would become string '2 -3'.
This commit fixes the minus sign interpretation by the lexer, ignoring whitespaces in front of the '-' sign and with an additional case to support array_get's in format "@a[0]-value".
(d51ae037 by pieter12345)
Make Crypto functions aware of secure_string.
Also fixed a bug in secure_string where the decrypted char array was the
wrong size due to padding.
(35527f91 by ladycailin)
Use new lines when listing multiple include compile exceptions
(550706d2 by pseudoknight)
Fix deprecated class usages
(f8fd570d by pseudoknight)
Merge pull request #479 from Pieter12345/furnace_nbt_data_support
Add blockstate meta support for various containers (0fcd35ec by michael smith)
Replaced null checks with empty itemstack checks.
Due to these objects being wrapped into a BukkitMCItemStack, they are never null. So check for empty item stacks instead.
(23378b22 by pieter12345)
Added brewing stand bottle slot meta support.
Brewing stands only had support for fuel and ingredient meta, this adds support for the 3 remaining bottle slots.
(5d055bf1 by pieter12345)
Selected proper datatype for some metadata.
Fixup for the previous 2 commits.
(9575c85f by pieter12345)
Added item meta support to containers.
The now supported containers are: BrewingStand, Chest, Dispenser, Dropper and Hopper.
(d301d21d by pieter12345)
Added blockstate data support for furnaces.
Furnaces will now have a "burntime", "cooktime" and "inventory" metadata tag. "inventory" is an array with 3 possible keys: "result", "fuel" and "smelting".
This commit prevents set_pinv(pinv()) to erase furnace metadata and adds the ability to get/modify it.
(49f1061a by pieter12345)
Added NonInheritImplements.
This allows classes to declare that they implement a specific interface,
but does not strictly require that subclasses also implement this
interface as well (through inheritance). There is a custom compile check
as well, but in general, this requires using the Helper class as well to
correctly cast to the interface and check instanceof.
The use case imagined here is for serialization and/or cloning, where
you want some classes in the heirarchy to be serializable or cloneable,
but not necessarily subclasses of those classes.
(474e45e5 by ladycailin)
Add cmdline-install mechanism for Windows.
This installs a C# based launcher, which provides all the Windows
specific utilities to the system, but otherwise forwards all processing
on to the jar. This works much the same as the Linux launcher/bash
frontend. Unlike Linux, however, this is a much more complicated task,
and so there is a Visual Studios solution and everything included in
this commit.
There are still a few tasks remaining: Add the mscript.exe to the Path
so that it can be run from the cmd utility. Make the uninstall-cmdline
tool work. The prompt_* functions do not work yet.
Once these three things are done, this should be merged to master. (b6a7a6f2 by ladycailin)
Normalize all the line endings
(8b9e709b by ladycailin)
Saving files before refreshing line endings
(5f62cc3d by ladycailin)
Fix missing ENUMs being logged as errors on startup
(0844d147 by pseudoknight)
Coercion of string "false" to boolean now provides a warning.
This is usually not what the user meant to do, as string "false"
evaluates to boolean true. Therefore, when we try to coerce a string
into a boolean, we first check to see if it is the string "false" and
if so, issue a warning. Eventually, I would like this to be configurable
per file, or at least at a more granular level, but anyways, for now
this is a globally configurable warning in the logger-preferences.ini
settings.
This also required a change to the Static.getBoolean method, which has
been updated throughout the codebase to add a Target parameter.
However, because extensions may
be using this method, it remains backwards compatible for now, but
the no Target method is deprecated and should be removed at next major
version change. (7dd4957b by ladycailin)
Fix parameter encoding for http_request()
(a63cd4bd by pseudoknight)
Lots of minor refactoring (0b7c52ca by ladycailin)
Re-format code with correct spaces in control keywords (e3277698 by ladycailin)
Commit nb-configuration.xml.
This should standardize formatting across development platforms where
developers are using NetBeans. If a developer is not using NetBeans,
they need to replicate these settings in their editor. (eae33999 by ladycailin)
Update gitattributes with a few more text file definitions (f8d8b548 by ladycailin)
Format the entire project.
This likely breaks all other branches diffs. Those branches will
also need to re-format the code first. (f243a14c by ladycailin)
Bump several versions of dependencies in maven (40dc779e by ladycailin)
Fix bug for array params in WebUtility
(6ce8968d by ladycailin)
Add strict mode to preferences.ini. This allows a global setting.
Additionally, cleaned up the lexer code a bit, and made file options
higher priority than comments. Additionally, file options now have to
be the first non-comment, non-whitespace line in the file, but do not
have to be the VERY first thing in the file.
Whitespace changes, now that I have figured out how to use an IDE
correctly, these changes should start to have to happen less and less. (3034645c by ladycailin)
Update contribution guidelines
(3073a226 by ladycailin)
Add docs for File_Options and Strict_Mode.
Support file options docgen syntax highlighter. Also, added support for
using class based styling, instead of style based styling. In the
future, I will create a css class to do the styling, but for now, it
remains hardcoded.
(487fe9bf by ladycailin)
Finish importing Learning Trail articles
(5307cf39 by ladycailin)
Add string_contains, to be clearer in code
(ef2ca55e by ladycailin)
Merge pull request #478 from Pieter12345/lexer_optimization
Lexer file option support+optimization+bugfix. (ceede3e8 by ladycailin)
Fixup commit.
Addicentally ticked off 2 lines when reviewing changes, these are part of the last commit.
(e395707f by pieter12345)
Lex + preprocess + compile optimization.
Replaced ArrayList usage by a LinkedList. This has the following effect:
- get() goes from O(1) to O(n) unless an iterator is used, in which case it remains O(1).
- remove() in an iterator over the list goes from O(n) to O(1).
This commit also changes all iterations over the list to iterations using an iterator, making both get() and remove() O(1).
(320830fc by pieter12345)
Halved preprocessor runtime.
On a local ~140.000 character (3305 line) script, 3000 runs on each
script with one untimed run for possible initialization resulted in a
runtime of ~1.19ms on average for the old code and ~0.60ms on average
for this new code.
(86dfce79 by pieter12345)
Removed unnecessary assigns in the lexer.
Removed unnecessary assigns in the lexer.
(fafc90ff by pieter12345)
Lexer file option support+optimization+bugfix.
- Fixed a bug where the token for CONCAT_ASSIGNMENT would get assigned
string "/=" instead of ".=".
- Fixed a bug where ending a file with an unfinished unicode character
in a quote would throw an uncaught exception (ending file with '\u).
- Optimized the lexer. Using a script from my server, the lex time of
100 runs (with one untimed run before the loop) was ~108ms, this has
been improved to ~83ms (~23% runtime decrease).
- Added file options support in the lexer. Start with '<!', end with '>'
and a literal '>' could be obtained using '\>'. File options are only
allowed at the top of a file.
(0e8a1022 by pieter12345)
Git bug - Committing no changes.
When undoing this "change", it automatically returns. Committing might
be a way to get rid of it so I can use git again.
(656db803 by pieter12345)
Merge pull request #477 from Pieter12345/extension_event_error_handler
Extra error management for event handlers. (fe865b9a by ladycailin)
Extra error management for event handlers.
When CH or a CH extension receives an event it cannot handle due to
being binary incompatible with a dependency, the error remained uncaught
and was passed to the server software that fired the event. This commit
makes sure those errors are caught and logged with useful additional
details for a bug report.
(3ff3ef43 by pieter12345)
Git bug - Committing no changes.
When undoing this "change", it automatically returns. Committing might
be a way to get rid of it so I can use git again.
(610827e1 by pieter12345)
Cache native types to improve compile time.
Static.resolveConstruct() constituted over 16% of the total compile time on my test server. This reduces that to less than 1%.
(ca1b939d by pseudoknight)
Further clarify get_entity_vehicle() docs
(2bd9c670 by pseudoknight)
Fix cslice on strings being off by one
(c8ddc433 by pseudoknight)
Merge branch 'master' of me.github.com:EngineHub/CommandHelper
(30211d3c by ladycailin)
Fix Husk in spawn_mob() again
(370f146c by pseudoknight)
Pass FileOptions through the compiler and elsewhere properly
Still need to implement the parsing in the lexer, but anyways, once
that's done, it should go through the rest of the system just fine. (1259b75d by ladycailin)
Create the shaded jar in addition to the non-shaded jar.
This allows CH to be independently included by other projects. The
biggest difference is that people now need to download the
commandhelper-version-SNAPSHOT-full.jar instead of the non -full
version. Cmdline users need to re-run install-cmdline to update the bash
command, as the name of the jar is encoded in the script.
(67dc918c by ladycailin)
Merge pull request #475 from Pieter12345/compile_optimization
BugFix for ambigous command detection. (56c5c2ba by ladycailin)
Unit tests + static cmd text fix.
- Added unit tests for command ambiguity.
- Changed "LITERAL" ConstructType check to "STRING" to support static
strings and since I did not manage to find an example of something that
compiled to a literal in the command descriptor (it becomes either a
string or doesn't compile anyways).
(732baef4 by pieter12345)
Syntax convention.
Syntax convention. (a15045bf by pietje)
BugFix for ambigous command detection.
Many commands were not detected as ambigous properly. Examples:
- *:/cmd2 $arg AND *:/cmd2 $arg
- *:/cmd11 $arg $arg2 AND *:/cmd11 $arg $arg2 [$arg3]
- *:/cmd14 arg AND *:/cmd14 $arg
- *:/cmd15 arg AND *:/cmd15 [$arg]
This commit will cause ambigous commands to throw a compile exception as
expected.
The previous code caught an IndexOutOfBoundsException, which's
fillInStacktrace() costed ~35% runtime spent in
AliasCore.LocalPackage.consoleMSA(). This has been replaced with a size
check to reduce runtime for MSA compiles by roughly this 35% (as tested
with my scripts and setup on my server with 254 defined aliases).
(ff404b8f by pieter12345)
Merge branch 'master' of me.github.com:EngineHub/CommandHelper
(81f18582 by ladycailin)
Merge branch 'Lildirt-string_func_optimize'
(2f3df3ff by ladycailin)
Merge branch 'string_func_optimize' of https://github.com/Lildirt/CommandHelper into Lildirt-string_func_optimize
(11e778cb by ladycailin)
Added optimizations to string_starts_with, string_ends_with, and char_is_uppercase as well as example usage.
(f7a23c6c by lildirt)
Merge pull request #476 from Pieter12345/compile_optimization2
Keyword compile optimization. (78d77189 by ladycailin)
Keyword compile optimization.
Replaced an exception throw + catch with equivalent logic. On my server
with my setup, this removes ~6.5% of the total script recompile time.
(0e8018fb by pieter12345)
Merge branch 'master' of me.github.com:EngineHub/CommandHelper
(ae0adf9d by ladycailin)
Added Mixed.isInstanceof
Going forward, it would be super helpful if code didn't use instanceof,
but instead used this new method, as it will be required eventually. I
can probably make a thing that scans bytecode for usages of this, but in
the meantime it'll just be the honor system :D
(a03492ea by ladycailin)
Expand Preferences to add typesafe versions of methods (c2de1dd8 by ladycailin)
Merge pull request #474 from PseudoKnight/master
Add Events and other fixes to site deployment (08d2c375 by ladycailin)
Add Events and other fixes to site deployment
(a37a3d98 by pseudoknight)
Merge pull request #472 from Pieter12345/compatibility_fixes
Compatibility fixes (e7df36c2 by ladycailin)
IDE with whitespace in workspace dir compatibility.
- Added URL decoding and encoding to support having a workspace with
whitespaces in the path (before this commit, many tests would be unable
to run due to ClassInitializationErrors).
(6c6d45fe by pieter12345)
Removed JVM error file.
This should likely have never been added.
(09ac5472 by pieter12345)
Clarify get_entity_vehicle() documentation
(eb5f6842 by pseudoknight)
Merge pull request #473 from Pieter12345/patch-1
Updated sk89q repo in pom. (15693581 by ladycailin)
Updated sk89q repo in pom.
Repository "mvn2.sk89q.com" has been replaced with "maven.sk89q.com" long ago. The mvn2 repository is currently offline and might never come back, the replacing repository is online and recommended over the deprecated one (source: wizjany). (d2962a2f by pietje)
Add get_vector() that returns a vector array from the yaw/pitch in a location array
(ea39a1df by pseudoknight)
Remove minor redundant array casting and logic
(628dd3b7 by pseudoknight)
Support a direction in location_shift() in place of a target location
(87330f83 by pseudoknight)
World functions formatting
(6d4d446d by pseudoknight)
Fix array_sort() when given an associative array
(14a024d3 by pseudoknight)
Improve core error logging.
Logging these errors is already slow, but the slow Main.loadSelfVersion() makes it take almost twice as long. This can cause noticeable tick lag. If this occurs with enough frequency the server will become unresponsive. So here we use the cached version from Bukkit when possible. The messaging is also improved a little.
(f392447a by pseudoknight)
Fix version check for snowman derp
(b7deec72 by pseudoknight)
Update entity_interact to use block name
(69743091 by pseudoknight)
Override methods in CSecureString that don't make sense to inherit
Also, needed to change array_get to work properly with ArrayAccess,
instead of assuming it is a string, if it is ArrayAccess and not a
CArray. array_normalize only makes sense with an actual array, so that
change to ArrayAccess was a bit premature. That change might actually
break some people's code, but whatever they were doing didn't make sense
in the first place, so you're welcome?
(f9ea6036 by ladycailin)
Add (decrypt_)secure_string.
These functions actually allow access to the CSecureString mechanisms.
In the future, it will now be possible to backport other methods to use
this data type.
(c0ca35be by ladycailin)
Merge branch 'master' of me.github.com:EngineHub/CommandHelper
(5a2016e7 by ladycailin)
Implement base classes for CDecimal and CSecureString
At current, these are not useable, as they are not constructable from
mscript. The CDecimal can be constructed in *some* cases in code using
0m notation, but it cannot be used beyond general Object use.
(b43adf42 by ladycailin)
Merge pull request #471 from Pieter12345/GetConstruct_improvement
Improved runtime complexity GetConstruct/GetPOJO (8e11e27d by michael smith)
Improved runtime complexity GetConstruct/GetPOJO
Both the GetConstruct and GetPOJO methods contained loops over
Lists/Maps with a getter of a value from those Lists/Maps in them,
effectively being O(n^2) runtime complexity (with an exception of Hash
implementations, where a lookup is O(1) instead of O(n)).
In this commit, those loops have been changed to loops over the entryset
(for Maps) or changed to using an iterator (Lists). The new runtime
complexity for both is O(n).
(0888be09 by pieter12345)
Add what was hit in the projectile_hit event
(f487f4f5 by pseudoknight)
Support item arrays for phas_item(), pitem_slot(), ptake_item(), ptake_enderchest_item(), and take_from_inventory().
This adds new filtering possibilities with those functions as well. Only specified keys in the item array are compared, with the following keys supported: data, display, lore, and enchants. If not specified, the key can have any value and be a match. (eg. phas_item(array('name': 'DIAMOND_SWORD', 'meta': array('display': 'Pointy'))); will match all diamond swords named Pointy, regardless of enchants, lore or durability) More keys may be added later.
(6eebf68b by pseudoknight)