Commit Graph

134 Commits

Author SHA1 Message Date
Mystiflow
c1522ab94c
#2909: Don't serialise as array for single element contents 2020-07-16 18:53:23 +10:00
Mystiflow
0af4bfdbdf
#2905: HoverEvent getValue compat method 2020-07-15 09:05:05 +10:00
md_5
94c4fcbad7
Bump version to 1.16-R0.3-SNAPSHOT 2020-07-13 08:45:48 +10:00
md_5
a99f62f693
Release 1.16-R0.2 2020-07-13 08:23:55 +10:00
Mystiflow
fd4864d475
#2899: Various chat API stability updates
- Check if a value CAN be parsed as a BaseComponent[] before attempting to parse it through the Content deserialiser
- When removing enclosing quotes from deserialised NBT, don't remove all quotes as they may have been escaping
- Check for ALL the number suffix types
- Throw JSONParseException if: no selector in selector component, no translate in translate component
- JsonObject is not JsonPrimitive
- Cleaned up unit tests a bit
2020-07-09 19:14:01 +10:00
Mystiflow
bcc3460dda
#2893: Refactored Hover Code for Maintainability 2020-07-07 09:09:32 +10:00
Erik Eide
4794fccfb8
#2888: Correct font check in BaseComponent 2020-07-06 08:10:42 +10:00
Mystiflow
637e7e93e0
#2884: Mojangson in hover events cannot be parsed 2020-07-05 19:09:59 +10:00
Mystiflow
1d40b8a88a
#2866: Add support for contents in Hover Event 2020-07-01 10:57:09 +10:00
Max Lee
e21b0b3773
#2870: Add rgb values to all colors 2020-06-26 18:42:49 +10:00
Max Lee
c803f42a84
#2867: Add font setter to ComponentBuilder 2020-06-26 09:52:31 +10:00
md_5
4786c0986b
Bump version to 1.16-R0.2-SNAPSHOT 2020-06-25 08:36:25 +10:00
md_5
a7180850e0
Release 1.16-R0.1 2020-06-25 08:36:03 +10:00
md_5
739b496bf6
#2858: ChatColor#ordinal is missing 2020-06-24 08:34:05 +10:00
md_5
75af27acf1
Fix missing static on ChatColor.values 2020-06-24 07:19:46 +10:00
md_5
d0fd673b60
Minecraft 1.16 support + RGB ChatColor preview 2020-06-24 07:00:00 +10:00
md_5
727281e69e Make all BaseComponent.duplicate methods specific 2020-05-10 09:24:40 +10:00
Alex_qp
4e99a32537 #2808: TextComponent.duplicate should return TextComponent 2020-05-10 09:24:40 +10:00
md_5
68cc325ace #2755: Add ClickEvent.COPY_TO_CLIPBOARD 2020-01-19 10:18:54 +11:00
md_5
2c6a21d503 Remove stray import breaking build 2020-01-18 10:15:25 +11:00
BlackHole
b7e7274b98 #2750: Don't special case TextComponent constructor with a single extra 2020-01-16 10:45:29 +11:00
BlackHole
22d2cd3388 #2747: Fix TranslatableComponent.deserialize() 2020-01-13 09:19:07 +11:00
md_5
d20e622b7b Apply checkstyle to javadoc 2020-01-05 11:25:56 +11:00
CertainLach
465215686b #2740: Fix BaseComponent#equals() stack overflow 2020-01-05 10:44:40 +11:00
Mystiflow
d2ceccd646 #2725: Various improvements to chat API
* More versatile ComponentBuilder system
    - Allow creating a builder without an initial component
    - Duplicate the parts when component is created
    - Add getter for 'parts'
* Added cursor API for more fluid component modifying
* Don't legacy convert Titles on 1.11 or newer
* Simplify plain and legacy text converting code
    - Shares the addFormat method between all superclasses
    - Duplicate code in TranslatableComponent moved in separate method
2020-01-05 10:40:07 +11:00
md_5
4cccf53775 Minecraft 1.15 support 2019-12-11 08:00:00 +11:00
md_5
8eb5683783 Bundle 1.14.2 translations 2019-06-09 19:35:11 +10:00
md_5
af10f82d14 Apply and enforce import ordering rules 2019-04-23 15:23:40 +10:00
md_5
3f01748d75 Minecraft 1.14-pre5 support 2019-04-23 12:00:00 +10:00
md_5
5aaccd2e9e #2621: Fix score component serialization 2019-04-06 19:54:17 +11:00
kamcio96
7496b0a2c8 #2584: Add ComponentBuilder#appendLegacy 2019-01-20 20:02:32 +11:00
NayXegp
6c44ccd597 #2527: Minor cosmetic cleanups to imports etc
Please see https://github.com/SpigotMC/BungeeCord/pull/2527
2018-11-02 18:06:56 +11:00
md_5
ed6b03d24a Always use root locale for case conversions 2018-10-28 12:10:34 +11:00
md_5
9ea82e9541 Add multiple translation registries, support for Mojang JSON 2018-08-16 07:52:41 +10:00
Simon Chuu
77b0a38c26 #2457: Allow objects in with to be translated into a string (for integer, float, etc.) 2018-07-15 11:39:46 +10:00
md_5
b1cc72e212 Minecraft 1.13-pre7 support 2018-07-15 10:00:00 +10:00
PROgrm_JARvis
ceb9ea1e52 #2436: Extend chat module with Joiner functional interface support 2018-07-12 21:44:59 +10:00
CosmoConsole
f54f0e3f6a #2421: fromLegacyText - return formatted component even if empty 2018-05-13 10:10:07 +10:00
md_5
dce4ea193a #2396: Add way to select reset color when parsing legacy chat 2018-04-01 09:36:46 +10:00
md_5
d4bbe0d8db Fix formatting in ComponentsTest 2018-04-01 09:31:00 +10:00
Mystiflow
d7eef6ff2e #2388: Treat BaseComponent array appends as one. Fixes #2387.
Don't copy formatting of previous element in the array being appended
but instead from the last appended component in the builder.
Otherwise formatting will be overridden in an incorrect way from
legacy text conversions.

Added unit test failed before this change. Now passes.
2018-03-14 19:51:08 +11:00
Joe
7653a5f0f8 #2363: Chat Component API Improvements
- duplicateWithoutFormatting deprecated and now works to include extra. Less maintenance required for any component implementations.
- Improved copyFormatting API to allow for retention copying.
- API to append a single BaseComponent in a ComponentBuilder, previously had to wrap a
component in its own array to do this.
- BaseComponent retain API that functions the same as from
ComponentBuilder.
2018-03-05 18:25:48 +11:00
Senmori
a3b44aa612 #2342: Add score and selector components to chat API 2018-02-19 11:48:22 +11:00
md_5
ca8f31bdc7 Merge unit tests 2018-01-28 18:00:24 +11:00
md_5
2d7c74eae5 Move chat component test to right place 2018-01-28 17:59:32 +11:00
md_5
9b2bb07d89 Fix some source code formatting 2018-01-28 10:23:52 +11:00
Gabscap
c0356eb72d #2333: Fix StringIndexOutOfBoundsException in TextComponent.fromLegacy 2018-01-28 09:59:34 +11:00
md_5
22bd43f725 Use root locale for upper / lowercasing 2018-01-12 08:17:44 +11:00
md_5
dda0638869 Make bungeecord-chat API classes final - the API does not (nor should) support subclassing. 2017-12-26 15:30:48 +11:00
BlackHole
fbc5f514e2 Add KeybindComponent API 2017-11-10 11:14:17 +11:00
Mystiflow
3db9fb1b69 #2255: Fix ComponentBuilder clone constructor
* Fix ComponentBuilder clone constructor #2255
* Fix appending text to a ComponentBuilder if current is not a TextComponent
2017-09-16 16:06:51 +10:00
Mystiflow
fd675022c0 Allow appending BaseComponent arrays in ComponentBuilder 2017-08-13 12:40:44 +10:00
md_5
1039554039 Update Mojang translations to 1.12.1 2017-08-09 16:45:53 +10:00
md_5
a6483db3df #2157: Check insertion on hasFormatting 2017-06-08 18:52:46 +10:00
md_5
ff891c000e Update to Minecraft 1.12 2017-06-08 18:00:00 +10:00
md_5
16d261553c Minecraft 1.12-pre2 Support 2017-05-14 12:00:00 +10:00
md_5
9ecdde2292 Add support for Minecraft 1.11
Improve QueryHandler session handling as suggested by IchBinJoe
2016-11-15 02:40:46 +11:00
MiniDigger
24a65d8fa9 Update mojang-translations to 1.10.2 (#1969) 2016-10-11 20:12:59 +11:00
Brokkonaut
b374a69b2c Do not change ComponentBuilder's contents when calling create()
This allows continuing to use ComponentBuilder after create() has been called.
2016-07-21 10:48:53 +10:00
md_5
a05e695db9 Initialize no args TextComponent with blank text. 2016-07-18 13:32:17 +10:00
md_5
e4cf010bda Update to Minecraft 1.10 2016-06-09 11:44:06 +10:00
md_5
80b3135a93 Fix formatting 2016-04-24 22:31:04 +10:00
kashike
aaddc9fcfd Remove an optimization for simple components. Removes a workaround needed for 1.9
Previously we could optimize components with only a text value to a string
instead of a full object but with 1.9 we can no longer do this for every case.
The size reduction from this optimization was small anyway.
2016-03-16 17:12:56 +00:00
Thinkofdeath
fc64a6c2ff Manually wrap serialized components in an extra text component to work around a 1.9 change (Fixes #1770) 2016-03-01 22:47:11 +00:00
md_5
05de455a9c Update to Minecraft 1.9 2016-03-01 09:31:12 +11:00
BlackHole
7d2c2ab074 Add ComponentBuilder.insertion() 2016-02-22 08:44:57 +11:00
Jedediah Smith
40c0618a3a Fix NPE from duplicating TranslatableComponent 2016-02-04 23:12:19 +00:00
BlackHole
fa3678bcdd Add new 1.8 chat features 2016-02-04 23:11:35 +00:00
Luuk Jacobs
81bd3b5f71 Fix typo in ClickEvent.java 2016-01-05 09:14:34 +11:00
zml
bd07be8772
chat: Correct placeholder handling in translatable
This change makes TranslatableComponent still scan a
translation string for placeholders, even if the translation string
itself is being used (rather than a value found from the
ResourceBundle). This matches vanilla behavior and allows plugins that
use this system with serverside translations and other custom
translation systems to send output to the server console correctly.
2015-08-30 14:50:37 -07:00
sha-2
6c4e684de9 Move the compiler configuration to properties 2015-05-31 10:51:49 +10:00
Adam
70564d9f44 Fix BaseComponent.duplicate() ignoring extra 2015-05-18 20:18:57 +10:00
Nick
5236dd301a Use an actual ArrayList when creating a TextComponent with extras.
Arrays#asList returns a java.util.Arrays.ArrayList which does not support adding more elements.  This previously broke BaseComponent#addExtra.
2015-05-18 20:16:45 +10:00
Tux
88e71ead05 Add reset() and retain() methods to ComponentBuilder.
This method is simple: it resets the current part to default settings, keeping only the current text. It therefore acts like the old ChatColor.RESET
code. The retain method allows for more control over what is reset.

Add a test to verify proper functioning of reset()/retain().
2015-05-06 09:57:48 +01:00
Jonas Konrad
78ea41015f Fix component deserialization on obfuscated and strikethrough tags 2015-03-16 20:24:37 +11:00
md_5
61cee2d27c Fix formatting in a bunch of files. 2015-02-14 18:36:58 +11:00
Jonas Konrad
668cdabdf7 Fix BaseComponent.toString stack overflow 2015-02-14 18:21:43 +11:00
md_5
7c1f232e85 Update depend versions, limit use of most Java 1.7 APIs. 2015-02-08 13:07:41 +11:00
mrapple
54c9ade1a6 Move mojang translations to chat module, fixes SpigotMC/BungeeCord#1301 2014-12-23 19:23:24 +11:00
md_5
cd15b82361 Compile chat API with 1.6 2014-12-16 16:09:25 +11:00
Minecrell
f19cc7fe4f Add chat position API. 2014-11-22 09:17:37 +11:00
md_5
57a07dc2e2 Update Depend Versions:
Guava 17.0 -> 18.0
Lombok 1.12.6 -> 1.14.8
Gson 2.2.4 -> 2.3
SnakeYaml 1.13 -> 1.14
2014-09-25 11:05:21 +10:00
md_5
2cec5f344a Update versions to 1.8... oops 2014-09-01 16:56:03 +10:00
md_5
faa284c8fc Move chat API into own submodule. 2014-08-31 18:56:03 +10:00