Compare commits

...

442 Commits

Author SHA1 Message Date
RebornTrack970
4dcac119d8 Updated TR Bundle to the latest V7 prealpha (#5505)
* Updated TR Bundle to the latest V7 prealpha

* Update bundle_tr.properties
2021-06-30 13:24:52 -04:00
Anuken
f9dfd5b0b5 Commented out separator revision until 128 release 2021-06-30 13:08:19 -04:00
Patrick 'Quezler' Mounier
10dcd9cb2d outlaw separator desycning (#5516)
* Seed separators

* Sync separators

* Seed from tile position
2021-06-30 12:59:09 -04:00
Anuken
c80e800ac9 Merge remote-tracking branch 'origin/master' 2021-06-30 10:49:29 -04:00
Anuken
eafcbf0914 Minor unit balancing 2021-06-30 10:28:05 -04:00
ulwepo
4f561a3875 Update servers_v6.json (#5515)
Sakura is a Japanese server.
I add attack mode.
Thank you.
2021-06-30 08:34:18 -04:00
Thomas Widyantoko
5cc92506c9 [ID] Updates Indonesian V7 translation (#5513)
* Indonesian bundle update

lenum.controller description and Tar Fields map

* translation bundle sync

* Indonesian translation standardization

* healing status effect

* Indonesian translation for V7

bit confused on line 1611

* [ID] WIP polygonal core protection

* [ID] Updates Indonesian V7 translation

Logic wait & content look up instructions
2021-06-30 08:34:08 -04:00
Arik
2c8eb1e5b8 Conveyor Upgrade End Rotation (#5512) 2021-06-30 08:29:35 -04:00
Anuken
6c18634b0d Minor logic unit rotation fix / Core capture unit derelict tareting 2021-06-29 16:26:02 -04:00
Anuken
c7bd9dd0fa Merge remote-tracking branch 'origin/master' 2021-06-29 12:21:56 -04:00
Anuken
d8ec231a5e Fixed #5508 2021-06-29 12:21:42 -04:00
Arik
5c803594fb Fix WaveGraph Lineup (#5503) 2021-06-29 09:03:56 -04:00
Minxyzgo
cececa190a Update WaterMoveComp.java (#5504) 2021-06-29 08:54:10 -04:00
OSP
38a3f1839e Change ip XCore, and add new server (#5502) 2021-06-28 18:58:39 -04:00
Anuken
2eb57ab680 Minor repair turret nerf 2021-06-28 18:57:13 -04:00
Anuken
f6f1ddb826 Fixed non-existent fire being targeted 2021-06-28 13:30:54 -04:00
Anuken
fcdbd4b117 Fixed liquid turrets not targeting closest fire 2021-06-28 11:35:46 -04:00
Anuken
a5c44e7998 #5055 2021-06-28 10:50:04 -04:00
Anuken
8afea88023 Fixed #5500 2021-06-28 10:15:54 -04:00
Anuken
75443e4dfc Clear commanding units on sync 2021-06-28 09:56:49 -04:00
Anuken
fbfb491dca Merge remote-tracking branch 'origin/master' 2021-06-28 09:25:48 -04:00
Anuken
082c17da85 Fixed #5498 2021-06-28 09:25:38 -04:00
thedimas3007
88ebf4f9db Updated (#5497) 2021-06-28 09:12:25 -04:00
OSP
18825b1697 Change IP XCore (#5494)
the old hosting is broken.
2021-06-27 18:47:11 -04:00
BasedUser
551b11877d CRAPPY DDNS IS GONE 🦀🦀🦀 (#5495) 2021-06-27 18:47:01 -04:00
Anuken
0bd1b4eedc Skip loading team regions for teams without palettes 2021-06-27 12:28:40 -04:00
Anuken
d401d7838c Gradle 7.1 2021-06-27 11:10:07 -04:00
Anuken
8b2e273d41 Merge remote-tracking branch 'origin/master' 2021-06-27 09:34:59 -04:00
Anuken
bdff6f9560 Repair turret nerf 2021-06-27 09:34:54 -04:00
Fatonndev
bb500a53ef Add attack v7 server (#5490) 2021-06-27 09:13:22 -04:00
Volas171
7ff0811764 retire mindustry reborn from v6 (#5487) 2021-06-27 09:13:03 -04:00
Anuken
36b49b6d8b Fixed #5488 / Fixed #5489 2021-06-27 09:12:35 -04:00
Anuken
e8edfb1170 Merge remote-tracking branch 'origin/master' 2021-06-26 20:55:59 -04:00
Anuken
bc6fcbc86d Fixed more flaky tests 2021-06-26 20:55:52 -04:00
OSP
8853ca303e Add XCore server to the v7 global list (#5486)
My server, 1 mode - the siege.There will be more servers in the future.
2021-06-26 15:46:19 -04:00
L0615T1C5-216AC-9437
914a6fc89b Add Chaotic Neutral to the V7 Server List (#5484) 2021-06-26 14:07:02 -04:00
UnCaughT
028be85468 Add HexPvP to V7 (#5483) 2021-06-26 14:06:56 -04:00
Darkness6030
5ffc285e1c Add mindurka to V7 list (#5471)
* Add mindurka to V7 list

* Update servers_v7.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>

* Update servers_v7.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>
Co-authored-by: Anuken <arnukren@gmail.com>
2021-06-26 12:29:56 -04:00
Anuken
604e6f8c47 Catch NoClassDefFoundErrors on ClientLoad 2021-06-26 11:11:27 -04:00
Anuken
4ac4f10ea0 Log mismatch errors for net buffers 2021-06-26 11:08:45 -04:00
Anuken
4c07733857 Fixed #5481 2021-06-26 11:04:03 -04:00
Anuken
7dc0f4dbc5 Merge remote-tracking branch 'origin/master' 2021-06-26 10:12:04 -04:00
Anuken
22f64fa2a5 Revert naval balance changes for now 2021-06-26 10:11:59 -04:00
KotMilkMeoW
5b0f1b5c03 Server upgrade to v7 (#5480) 2021-06-26 09:54:18 -04:00
Anuken
c6e0292d03 Fixed clientside physics jitter 2021-06-26 09:52:03 -04:00
Anuken
17eee61a93 Fixed #5478 2021-06-26 09:34:25 -04:00
Anuken
3817b159cf Reduced jittery interpolation 2021-06-26 00:19:23 -04:00
Anuken
331cf2e269 arc 2021-06-25 22:58:30 -04:00
Anuken
96622848d9 Hide outdated lobbies on Steam 2021-06-25 19:49:53 -04:00
Anuken
bcdc8867e6 Merge remote-tracking branch 'origin/master' 2021-06-25 19:36:07 -04:00
Anuken
eaeb67b91f Fixed #5474 2021-06-25 19:35:34 -04:00
Catchears
ebd444cc5f final v7 german translation (#5473) 2021-06-25 16:57:20 -04:00
L0615T1C5-216AC-9437
ff1ab9dd42 Add Chaotic Neutral Survival to BE Server List (#5435)
Co-authored-by: Anuken <arnukren@gmail.com>
2021-06-25 16:22:11 -04:00
Ilya246
7e2c830f9c Add .pl to 7.0 serverlist (#5466)
* Add .pl to 7.0 serverlist

.pl will move to 7.0 once b127 is out
Somka currently can't make a PR by himself so i asked him whether i should and, after a positive answer, did it for him

* Update servers_v7.json
2021-06-25 16:01:38 -04:00
Volas171
0cc2214951 Add Mindustry Reborn to V7 Alpha list (#5470)
* v7

* be removal

* formatting

Co-authored-by: Anuken <arnukren@gmail.com>
2021-06-25 14:41:24 -04:00
Anuken
47443d5ae7 Merge remote-tracking branch 'origin/master' 2021-06-25 14:37:36 -04:00
Anuken
cd2c605036 Suppress certain mod errors on client load 2021-06-25 14:37:32 -04:00
RebornTrack970
847e46d270 Add Beta 2r2t to V7 (#5468)
* Add Beta 2r2t to V7

Other Omega Servers will likely get updated to V7 too, for now, only 2r2t has a Beta.

* Update servers_v7.json

* Update servers_v7.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>

* Update servers_be.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>
2021-06-25 14:26:54 -04:00
Anuken
3d6cfcafd0 Don't assign players to derelict 2021-06-25 14:11:36 -04:00
Patrick 'Quezler' Mounier
cb2ed1c549 Update filenames within the server json test (#5469) 2021-06-25 13:42:47 -04:00
Anuken
d86d2dbdb9 Delete servers.json 2021-06-25 13:35:15 -04:00
RebornTrack970
0546d6cf55 TR Bundle Change: Bug Fix (#5404)
* TR Bundle Change: Yakalandı -> Elegeçirldi

* Bug Fix
2021-06-25 13:30:08 -04:00
Jaekwon Park
9b3a8c201f Add to new Korea Server (#5397)
* Add to new Korea Server
2021-06-25 13:09:11 -04:00
彭瑞暄
1bf3345b2f Update bundle_zh_TW.properties (#5364)
translation for new block and naval unit names
2021-06-25 13:08:44 -04:00
Antsiferov Andrew
a8dd868df2 [Bundle][RU] Update (#5354)
* double newline fix

hint.guardian

* 13 changed lines

mod.enabled
mod.disabled
status.burning.name
status.freezing.name
status.wet.name
status.melting.name
status.sapped.name
status.spore-slowed.name
status.tarred.name
status.overclock.name
status.shocked.name
status.blasted.name
status.unmoving.name

* yon't

* x'nt

* Update bundle_ru.properties

* 1 new, 1 changed

New:
stat.healing

Changed:
bullet.healpercent

* Inverse trig logic functions

See 00ca247d0f

* new v7 stuff, long list

New:
schematic.tags
schematic.edittags
schematic.addtag
schematic.texttag
schematic.icontag
schematic.renametag
schematic.tagdelconfirm
schematic.tagexists
tps
guardian
sector.changeicon
status.electrified.name
unsupported.environment
stat.repairspeed
ability.energyfield
bar.strength
rules.corecapture
block.rhyolite.name
block.repair-turret.name
hint.blockInfo
lenum.config
laccess.progress
unit.retusa.name
unit.oxynoe.name
unit.cyerce.name
unit.aegires.name
unit.navanax.name
block.duct.name
block.duct-router.name
block.duct-bridge.name
block.payload-propulsion-tower.name
block.payload-void.name
block.payload-source.name
filter.option.rotate

Changed:
stat.repairtime
bullet.pierce
team.crux.name
team.sharded.name
item.titanium.description

Deleted:
quit.confirm.tutorial
boss.health
team.orange.name
lenum.configure

* Update bundle_ru.properties

* 1 line changed

unit.oxynoe.name

* роутер-marshrutizator

ibglish

* 2 lines changed

block.surge-wall.name
block.surge-wall-large.name

* 3 new, 2 changed

New:
stat.showinmap
block.metal-floor-4.name
block.metal-floor-5.name

Changed:
stat.affinities
stat.opposites

* undone the dumb

* 1 new line

filter.option.replacement

* 1 new, 1 changed

New:
rules.polygoncoreprotection

Changed:
hint.respawn

Co-authored-by: Vanguard <55051135+XEN0PHIL@users.noreply.github.com>
2021-06-25 13:00:44 -04:00
VizardAlpha
6dc6c2ebba Update full_description.txt for Android (#5399)
* Update full_description.txt for Android

Update full_description.txt for Android

* Update full_description.txt Android
2021-06-25 13:00:29 -04:00
Sharlotte
3b3abdf87e [KO] Update Latest Bleeding-Edge bundle (#5430)
* [KO] Update Latest Bleeding-Edge bundle

* Update bundle_ko.properties

* I wonder why sk didn't just edit file skself.

* typo

* ohno there is too many HIDDEN TYPO WHAT THE FUCK

* more typo

* new translated bundle. NOW IT'S DONE
2021-06-25 12:59:55 -04:00
YellOw139
e0e124ee57 [Bundle][RO] Update (#5431)
Changelog:

- New strings/changes up to commit 865ee952c9
- Typo fixes & various other improvements
2021-06-25 12:59:45 -04:00
Ngọc Lam
cfba83018e Update Vietnamese Translation for V7. (#5432)
* V7 translation update (Part 1)

* V7 translation update (Part 2)

* A lot of typo.
2021-06-25 12:59:36 -04:00
TRinny
79581edaa0 Update bundle_th.properties (#5319)
* Update bundle_th.properties

My first time here. someone requested in discord so I made this.
-overhaul the translation to V6
-fixed typos
-my mom complained me for staring at computer all day
-blocks and block descriptions unfinished; might make more commits

* Update bundle_th.properties

more fixes
replace tutorial with v6 hints (still unfinished)
more work than I thought, will make this a draft

* Update bundle_th.properties

Almost finish, missing only like... 100 lines

* Update bundle_th.properties

Finally finished! thank you, Anuke, for making this great game!

* Update bundle_th.properties

-Translation Clean-up
-Update the translation to . . . v7?
-If you don't mind I'll add myself to Translator list.

* Update contributors

Add myself to the translator list... If you (Anuke) don't mind.

* Update bundle_th.properties

More clean-up

* Update contributors

fixed conflicts

* Update contributor (again)

sorry, genNAowl

* Update bundle_th.properties

Another Clean-up

* Update bundle_th.properties

how many clean-up I have to add!? hope this is final.

* Update bundle_th.properties

13th commit. Minor clean-up

* Update bundle_th.properties

14th commit. Minor clean-up

* Update bundle_th.properties

Maybe final change.

* Update bundle_th.properties

The Perfect Edition.

* Update bundle_th.properties (maybe final)

Minor Tweaking #1. Final(?)
Imagine changing like 400+ lines in the first few commits, then changing only 10+ lines in the final commits.

* Update bundle_th.properties

imagine fixing 1 line of code.

* Update bundle_th.properties

Another 1-line fix. I'll fix like this until its complete for me or it got merged

* Update bundle_th.properties (to v7)

not really a clean-up, add more v7 things.

* Update bundle_th.properties

Clean-up a bit since naval support name is a bit weird.

* Update bundle_th.properties

simplified units/blocks descriptions. Also clean-up and tweaks.

* Update bundle_th.properties

Fixed description again, also make translation more natural and less like using google translate.

* Update contributors

Just don't wanna fix conflicts again and again when something got merge, may triggers someone (sorry...)

* Update bundle_th.properties

improved many things I missed in the test.
Add an experimental description, will be removed in the next commit (or added in if it success!)

* Update bundle_th.properties

Add scrap walls descriptions and fixed many things.

* Final. or not?

Fixed misspellings and updated description. Final (right? RIGHT?)

* Final

Add a details of mats. fixed thingies. Final, (right RIGHT?)

* Real Final. no further commit unless new lines.

1-line fix, now I'll wait for 'someone' to review my change. I'll NOT make any changes from here now unless major problem found or new updates from Anuke OR someone reviews (Please... review it)

* new lines

added new lines (and removed some too) also fixed some lines and added details to mats.

* new details to liquids

added details to liquids and also typical fixes.

* hotfix

ah yes, typo hotfix

* minor(?) fixes

minor(or major?) fixes to descriptions and make sense of things.

* add polygonal core protection

add polygonal core protection and fixes abilities to v7. also fixes moth => mod.

* minor fixes to descriptions

minor fixes to descriptions and also knowing what 'Bitwise' is.

* updated descriptions

change duplicated name and also change other description to make it better. also turned 'Low'gic to 'Lo'gic.

* Create bundle_th.properties

I missed these during tests.

* fix spacing

fix spacing and typos

* that sound bad

fixed some words

* fixes for v127

had a deep check to prepare for v127, also changed eclipse's name to something formidable

* Hotfix

now everything is perfect

* Hotfix

now everything is perfect
2021-06-25 12:59:07 -04:00
Thomas Widyantoko
0b7c9dc8b1 [ID] Indonesian translation for V7, Part 3 (#5426)
* Indonesian bundle update

lenum.controller description and Tar Fields map

* translation bundle sync

* Indonesian translation standardization

* healing status effect

* Indonesian translation for V7

bit confused on line 1611

* [ID] WIP polygonal core protection
2021-06-25 12:57:40 -04:00
VizardAlpha
665207b9b0 [FR] Updates bundle_fr.properties for V7 (#5345)
* Updates bundle_fr.properties

Additions of commits from May 28, 2021 to June 3, 2021.

Corrections and translations

* Update bundle_fr.properties

Commits on Jun 4, 2021 added

* Update bundle_fr.properties

Corrections translation.

* Update for V7

Update for V7

* Add new commit

* Add commits..

Experimental core-capture PvP map / Editor filter fixes

* Add commits.

Polygonal core (WIP)

* Minor Translation

Minor Translation
2021-06-25 12:57:31 -04:00
Patrick 'Quezler' Mounier
0cd4ef575d Enforce social distancing (#5465) 2021-06-25 12:49:50 -04:00
Anuken
91f50883b1 Update deployment.yml 2021-06-25 12:42:02 -04:00
Anuken
756c717a9b Possible flaky test fix 2021-06-25 12:39:46 -04:00
Anuken
2cea277320 RoboVM debugging 2021-06-25 12:29:49 -04:00
Anuken
dd36b71c7f Updated RoboVM plugin 2021-06-25 12:18:28 -04:00
Anuken
5e3e07f002 Updated RoboVM 2021-06-25 11:56:28 -04:00
Anuken
0ffe2ed51a Skip launch pad destination text for clients 2021-06-25 10:27:10 -04:00
Anuken
02e6257a66 Fixed #5462 2021-06-25 09:18:11 -04:00
Anuken
57fd72f476 arc 2021-06-24 19:34:21 -04:00
Anuken
d2d7596ef1 Fixed Android deployment script 2021-06-24 18:30:01 -04:00
Anuken
149c48a03e Merge remote-tracking branch 'origin/master' 2021-06-24 17:58:30 -04:00
Anuken
bdeba22561 Switched to v7 server list 2021-06-24 17:58:26 -04:00
Anuken
640c7851cf Update servers_be.json 2021-06-24 17:57:38 -04:00
Anuken
c0991a9baa Create servers_v7.json 2021-06-24 17:57:27 -04:00
Anuken
5af6e8c5de Preparations for 127 pre-alpha release 2021-06-24 17:25:08 -04:00
Anuken
2d4677aa27 Reduced unit item glow 2021-06-24 17:00:33 -04:00
Anuken
984b646103 Merge remote-tracking branch 'origin/master' 2021-06-24 15:38:26 -04:00
Anuken
0949852758 Logic wait & content look up instructions 2021-06-24 15:38:20 -04:00
MEEP of Faith
d4c409252b Allow shock mines to spawn bullets (#5454)
* Allow shock mines to spawn bullets

* Fix up some issues
2021-06-24 08:39:37 -04:00
Anuken
38a9ad9ec1 Fixed #5455 2021-06-23 16:22:00 -04:00
Anuken
c70be45a25 Merge remote-tracking branch 'origin/master' 2021-06-23 14:02:10 -04:00
Anuken
186e8f707e Fixed #5453 2021-06-23 14:02:06 -04:00
Anuken
e3351e0c23 Typo fix 2021-06-23 11:59:02 -04:00
Anuken
b08f198629 Merge remote-tracking branch 'origin/master' 2021-06-23 11:57:55 -04:00
Anuken
1b3e99fbb0 Remove linear filtering on iOS 2021-06-23 11:57:51 -04:00
buthed010203
f74c153a47 or (#5449) 2021-06-23 08:47:14 -04:00
Anuken
2613ff6796 Fixed #5448 2021-06-23 08:46:50 -04:00
Anuken
c404e7e1c6 Fixed #5447 2021-06-22 16:54:32 -04:00
Anuken
d468a4f328 Removed unnecessary TODOs 2021-06-22 16:07:19 -04:00
Anuken
4417a83424 Merge remote-tracking branch 'origin/master' 2021-06-22 14:22:58 -04:00
Anuken
45dc72faf6 Removed unnecessary themes 2021-06-22 14:22:54 -04:00
Patrick 'Quezler' Mounier
42c643f769 Fix ammo multiplier exception in itemturret (#5446) 2021-06-22 13:35:28 -04:00
Volas171
b7d5f9a7ab Add Mindustry Reborn to v7 and v6 ServerList (#5444)
* reborn v6

* v7 reborn lol

* yikes
2021-06-22 10:33:38 -04:00
Darkness6030
7e7d6120ad Update mindurka ip (again) (#5443)
Sry, anuke
2021-06-21 14:16:44 -04:00
Anuken
d6566830ac Ignore Discord RPC exceptions 2021-06-20 08:48:05 -04:00
Anuken
12dfd71345 Minor load markup fix 2021-06-18 15:44:35 -04:00
Anuken
60b6e93f7c arc 2021-06-18 15:25:40 -04:00
Anuken
128174faa4 NOTHING 2021-06-18 15:19:28 -04:00
Anuken
7ab0c86978 Stencil buffer fallback 2021-06-18 15:14:08 -04:00
Anuken
5f0ec79b0f Fixed crash logs sometimes not saving 2021-06-18 09:33:12 -04:00
Anuken
15affaad9b Cleaner impact reactor explosion 2021-06-16 16:53:09 -04:00
MEEP of Faith
a74bc0c077 block destroyEffect (#5427) 2021-06-16 15:55:08 -04:00
Anuken
9088d9eb39 Polygonal protection bugfixes 2021-06-16 15:07:14 -04:00
Anuken
f11f390c1f Polygonal protection for built-in PvP maps 2021-06-16 14:51:37 -04:00
Anuken
865ee952c9 WIP polygonal core protection 2021-06-16 13:26:18 -04:00
Anuken
efcae883fb Experimental core-capture PvP map / Editor filter fixes 2021-06-16 11:09:18 -04:00
Anuken
fe9ff212b2 Stateless simplex 2021-06-15 19:28:54 -04:00
Anuken
210fb349de Less editor filter state 2021-06-15 12:26:00 -04:00
Anuken
69d8af7874 Editor filter seed saving & cleanup 2021-06-15 11:58:26 -04:00
Anuken
183c922b6b Do not save MirrorFilter temporary vectors 2021-06-15 11:32:49 -04:00
Anuken
964104db65 Merge remote-tracking branch 'origin/master' 2021-06-15 09:39:27 -04:00
Anuken
2d8f7cb680 Fixed #5425 2021-06-15 09:39:23 -04:00
Volas171
aef92fd3b0 remove mindustrypvp.ml (#5423)
we are leaving the list for the following reasons : 
we are renewing domain
coming back later (having some stability issue in moderation)
2021-06-14 23:24:26 -04:00
Anuken
a0f80a8865 it is solved 2021-06-14 11:35:53 -04:00
Anuken
6b5a743583 confusion 3 2021-06-14 11:33:00 -04:00
Anuken
28252173b4 confusion 2 2021-06-14 11:32:46 -04:00
Anuken
2e733273a0 confusion 2021-06-14 11:28:28 -04:00
Anuken
39f4e90fff s t o p 2021-06-14 11:23:47 -04:00
Anuken
22d1700fb2 JITPack appears to be throwing a fit (2) 2021-06-14 11:22:56 -04:00
Anuken
31c39e0148 JITPack appears to be throwing a fit 2021-06-14 11:15:06 -04:00
Anuken
e5b80c37eb Renamed misleading github jobs 2021-06-14 11:05:37 -04:00
Anuken
2a451aa41f Disable preview features 2021-06-14 10:59:38 -04:00
Anuken
1a03151966 Enforce JDK 16 as a minimum 2021-06-14 10:55:28 -04:00
Anuken
51040f9f3d Hash fix 2021-06-14 10:42:24 -04:00
Anuken
3ad16ab8aa Upgraded to Gradle 7 & JDK 16 2021-06-14 10:41:19 -04:00
Anuken
b58e64ea16 Fixed #5422 2021-06-14 08:47:38 -04:00
Anuken
7fe9e7f9c2 Merge remote-tracking branch 'origin/master' 2021-06-13 19:27:34 -04:00
Anuken
2d9204d638 I guess everything is unsafe now 2021-06-13 19:27:28 -04:00
QmelZ
de9c82d1d2 Freedom for javascript mods (#5421)
* remove blacklist and class shutter

* no context factory
2021-06-13 19:22:33 -04:00
Anuken
a756dec379 Fixed #5419 2021-06-13 11:02:17 -04:00
Anuken
5601f97266 Fixed #5418 2021-06-13 10:12:50 -04:00
Anuken
347b38ba26 Added unit tests for Java, JavaScript and JSON mods 2021-06-12 20:59:28 -04:00
Anuken
d6016f1b04 Support for hidden weather 2021-06-12 16:59:18 -04:00
Anuken
7ec713ab66 No URLClassLoader super delegation 2021-06-12 14:26:47 -04:00
Anuken
446c2d2dcb more mod loader fixes 2021-06-12 11:00:56 -04:00
Anuken
c5261cf2e5 Fixed #5414 2021-06-12 08:44:16 -04:00
Anuken
cb0382a15b Clipping bugfixes 2021-06-11 10:15:19 -04:00
Anuken
3527acd33e Mod class loading bugfix 2021-06-11 09:18:59 -04:00
Anuken
83854169b7 Fixed #5412 2021-06-11 08:51:34 -04:00
Anuken
dfd2b22917 Planet method renaming 2021-06-10 18:51:29 -04:00
Anuken
c4803d29da Pulverizer texture cleanup 2021-06-10 16:14:53 -04:00
VozDuh
a0acf1a040 Melter & Pulverizer Fixed (#5098)
Co-authored-by: Anuken <arnukren@gmail.com>
2021-06-10 16:01:04 -04:00
Anuken
8d9d6385f9 Editor variant regions for wall blocks 2021-06-10 15:52:33 -04:00
MEEP of Faith
af2830602d Let any block have variants. (#5372) 2021-06-10 15:42:01 -04:00
Anuken
e4bd3fab7c Removed MetalFloor class 2021-06-10 15:39:43 -04:00
Anuken
e3ea1bdaae Merge remote-tracking branch 'origin/master' 2021-06-10 15:10:56 -04:00
Anuken
a180aae838 Blending cleanup / Misc bugfixes 2021-06-10 15:10:52 -04:00
ulwepo
abcea8dd39 Update servers_v6.json (#5407)
This is Japanese server.
Add a survival server and a sandbox server.
Thank you
2021-06-10 09:35:44 -04:00
Anuken
448604062d Merge remote-tracking branch 'origin/master' 2021-06-10 09:32:05 -04:00
Anuken
bcdbca7337 Fixed #5410 2021-06-10 09:32:01 -04:00
Anuken
dd500a747b Update deployment.yml 2021-06-10 09:06:05 -04:00
Anuken
32d8f59b5a Merge remote-tracking branch 'origin/master' 2021-06-10 09:04:06 -04:00
Anuken
86bf068ac3 Fixed #5406 2021-06-10 09:03:57 -04:00
Anuken
ec2c273c97 Add an automatic item produce requirement 2021-06-09 22:55:48 -04:00
Romanin
a587477fc0 Renamed the category and added it easyplay.su (#5405)
We decided to rename the category in order to add to it EasyPlay.Su (we have an agreement)
2021-06-09 17:09:54 -04:00
Anuken
e3da0f713e Modded techtree bugfixes 2021-06-09 16:15:17 -04:00
Anuken
6f609aa4ee ConsumeCoolant 2021-06-09 14:38:49 -04:00
Anuken
c9ff84d03b Test fix 2021-06-09 14:03:29 -04:00
Anuken
b04c04f69f New metal floor / Selective floor attribute stats 2021-06-09 13:26:01 -04:00
Anuken
adf6465029 Child-first mod class loading 2021-06-09 10:04:23 -04:00
Anuken
a8a163ebe2 Fixed Android builds 2021-06-09 08:57:56 -04:00
Anuken
7dcfd648f7 Minor bugfixes 2021-06-09 08:37:26 -04:00
Anuken
1895c7b8e0 Updated Rhino 2021-06-09 08:32:09 -04:00
Anuken
91c0235ff5 #5402 2021-06-08 22:07:45 -04:00
Anuken
25b2458a92 Merge remote-tracking branch 'origin/master' 2021-06-08 21:59:01 -04:00
Anuken
28203ca6e9 Fixed regression introduced in #5361 2021-06-08 21:58:56 -04:00
MEEP of Faith
93fd3c6e18 Allow weapons on Miner units to function. (#5398)
`target` shouldn't affect anything because it is unused in `updateMovement()`
2021-06-08 14:05:56 -04:00
Anuken
95da46bfa2 Duct bridge input display 2021-06-08 11:49:55 -04:00
Catchears
8c1702cff5 Initial german translation for v7 (#5394)
* initial v7 translations

* forgot unsupported.environment

* resolve the duct issues
2021-06-08 10:20:00 -04:00
Anuken
8962992ef9 Fixed invalid healing effects 2021-06-08 09:14:54 -04:00
Anuken
a7de30ba53 RidgedPerlin cleanup / More river noise options 2021-06-07 20:38:17 -04:00
Anuken
2651a30f79 Merge remote-tracking branch 'origin/master' 2021-06-07 18:07:41 -04:00
Anuken
1c9589eb26 Editor filter bugfixes 2021-06-07 18:07:37 -04:00
SaltyBeggarBR
850ebe8156 Brazillian Portuguese translation huge revamp (bundle_pt_BR.properties changes) (#5395)
I changed a few things that were either translated wrong, had typos or just sounded weird and also added a lot of stuff that didn't have translation yet, like the new blocks.

I tested the changed bundle as a mod by simply saving the edited bundle text on the test mod folder, but I believe it should also work when merged into the source code, and also because it's something that is pretty simple.

Not everything is translated yet, logic commands and its tips still have to be translated. I believe some other stuff also doesn't have a translation, since I didn't do a general revision of the game to see that, although I believe almost everything should be translated now.

(for Brazillians):
Eu mudei algumas coisas que estavam ou erradas, tinham erros de português ou simplesmente soavam estranhas e também adicionei um monte de coisa que ainda não estava traduzida.

o bundle modificado foi testado como um mod simplesmente salvando o arquivo de texto modificado na pasta do mod de teste, mas acredito que também vá funcionar certinho quando colocado no código fonte em si até porque é algo simples.

Não é tudo que foi traduzido ainda, lógica e suas dicas ainda tem que ser traduzidas. Acredito que outras coisas também, foi não fiz uma revisão geral no jogo em português para saber, mas acredito que a maioria deve de estar traduzido agora
2021-06-07 18:05:19 -04:00
YellOw139
8a51a4be32 [Bundle][RO] Update (v7 pre-alpha) (#5365)
* [Bundle][RO] Update (v7 pre-alpha)

Changelog:

- New strings/changes up to commit 00ca247d0f
- Typo fixes & various other improvements

* old typo

* coolant strength
2021-06-07 16:40:07 -04:00
Anuken
a452cd94c6 arc 2021-06-07 15:25:56 -04:00
Anuken
0966b49ff7 Merge remote-tracking branch 'origin/master' 2021-06-07 15:04:57 -04:00
Anuken
0582cfac2b Prefer Team#data() for team data 2021-06-07 15:04:45 -04:00
IchHabeKeineNamen
5deb8a879e Update BlockRenderer.java (#5259)
1. Ensure consistency of code.
1. Make the code straightforward.
2021-06-07 15:00:31 -04:00
Anuken
f4db208d75 Merge remote-tracking branch 'origin/master' 2021-06-07 14:55:18 -04:00
Anuken
f73c49b246 Moved effect calls back to correct class 2021-06-07 14:55:14 -04:00
shift
93a197e7d9 [RU] Fix interplanetary accelerator description (#5392)
* [RU] Fix interplanetary accelerator description

Made it same as it's name

* Make translate close to original
2021-06-07 14:51:05 -04:00
KotMilkMeoW
861ca2c6ae Add server to global list (#5385)
* Add server to global list

Server.
There are already 6 modes: attack, PVP, Sandbox, Crawler Arena, Tower Defense, Survival.

* Add server to global list

New ip (because of the technical chocolates, it was necessary to change them)
2021-06-07 14:50:50 -04:00
Anuken
1fffbf3a79 Merge remote-tracking branch 'origin/master' 2021-06-07 10:47:57 -04:00
Anuken
82742339a3 Implementation of #5280 2021-06-07 10:47:53 -04:00
Tegas Aziz
11d85621e2 7.0 indonesian translations part 2 (#5390)
* 7.0 indonesian translations part 2

but i missed schematic.tag bundle

* Update bundle_in_ID.properties

* Update bundle_in_ID.properties

* Update bundle_in_ID.properties

* Update bundle_in_ID.properties

team.orange.name is deprecated
2021-06-07 08:43:19 -04:00
Anuken
a64efce5a0 Possible client-side interpolation jitter fix 2021-06-06 22:17:53 -04:00
Anuken
9be4461b54 Merge remote-tracking branch 'origin/master' 2021-06-06 21:01:55 -04:00
Anuken
7f01959438 Liquid turret shoot FX fixes 2021-06-06 21:01:47 -04:00
MEEP of Faith
a09771b569 Custom Unit Death Explosion Effects (#5389) 2021-06-06 19:38:12 -04:00
NiChrosia
79695086c6 Add powerDynamic to Consumers (#5205)
* Add DynamicConsumePower, and powerDynamic to Consumers

* Add period to description of DynamicConsumePower

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>

* Remove redundant Boolf

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>
2021-06-06 19:37:20 -04:00
RebornTrack970
4a922e4c10 Translate Bug Fix (#5383)
* Translate Bug Fix

* more?
2021-06-06 19:36:34 -04:00
Anuken
bfc059769f Merge remote-tracking branch 'origin/master' 2021-06-06 19:33:22 -04:00
Anuken
b0ab33f125 Duct input consistency 2021-06-06 19:33:15 -04:00
buthed010203
faa8c68c20 remove space & extra backets (#5384)
* remove space

* remove extra brackets
2021-06-06 14:50:56 -04:00
buthed010203
45f5e2ae90 remove stray newline (#5386) 2021-06-06 14:25:17 -04:00
Darkness6030
0859f92fea Domain for mindurka (#5381) 2021-06-06 14:23:52 -04:00
Darkness6030
698e4bc740 Domain for mindurka (#5380) 2021-06-06 14:23:43 -04:00
Anuken
300e3f2320 Merge remote-tracking branch 'origin/master' 2021-06-06 13:01:26 -04:00
Anuken
d4f22c4838 Icon fix 2021-06-06 13:01:21 -04:00
RebornTrack970
758b3bcb24 Turkish Translation 2 (#5374)
* Turkish Translation 2

Added a few V7 things, not final.

* More Missed edits.

Fixed until line 122

* Fixed Until Line 162

* Fixed Until Line 225

* Fixed until 300

* Mini bug fix

* Fixed Until 400

* Translator , i will complete TR translation.

* Fixed till 543

* Until 598

* Maps

* Until 762

* 908

* 984

* 1337 Tutorial be like

* More patch

* More missed trasnations!!!

* More!

* 1562

* Units

* Logic 1

* Logic 2

* Math

* More Math 2

* Nearly done

* Nearly doneeee

* Final Touch
2021-06-06 11:25:18 -04:00
Anuken
782c7a9ff3 Fixed #5379 2021-06-06 11:05:36 -04:00
Anuken
8d12dbbe70 Minor duct preview optimizations 2021-06-06 10:06:33 -04:00
Anuken
75abe7661d Merge remote-tracking branch 'origin/master' 2021-06-06 09:55:37 -04:00
Anuken
c318d4fa70 Cleanup 2021-06-06 09:55:33 -04:00
Patrick 'Quezler' Mounier
7a3a39d3b1 Draw duct bridges in schematics (#5378) 2021-06-06 09:55:24 -04:00
Anuken
a4895fef8b Fixed #5373 / Fixed #5375 2021-06-06 09:40:32 -04:00
Anuken
685adeee9d Minor salvo buff 2021-06-05 22:54:37 -04:00
Anuken
c8d2b7a39e Merge remote-tracking branch 'origin/master' 2021-06-05 16:55:18 -04:00
Anuken
41082e9429 Fixed #5371 2021-06-05 16:55:15 -04:00
RebornTrack970
04b7aad1bf Updated TR Bundle (#5367) 2021-06-05 16:37:41 -04:00
Anuken
d0b70fd70d Fixed map view on left-padded iOS devices 2021-06-05 15:47:39 -04:00
Anuken
3c008e6bd8 Merge remote-tracking branch 'origin/master' 2021-06-05 15:10:41 -04:00
Anuken
ade313fc1b Fixed infinite fire / Command center logic control 2021-06-05 15:10:34 -04:00
Catchears
d96626e0c4 update link to jdk in README.md (#5370) 2021-06-05 13:39:01 -04:00
Anuken
d0da46e715 Merge remote-tracking branch 'origin/master' 2021-06-05 13:38:38 -04:00
Anuken
9144f57b16 Fixed #5369 2021-06-05 13:38:32 -04:00
Patrick 'Quezler' Mounier
4ab115d007 Get rid of potentially white period (#5368) 2021-06-05 12:03:44 -04:00
Anuken
b4dad32b2b Status effect particle color pass 2021-06-05 11:10:26 -04:00
Anuken
c80f2d6cf4 Heal *all* cores on game start 2021-06-05 10:01:15 -04:00
Anuken
f87054c667 Merge remote-tracking branch 'origin/master' 2021-06-05 09:49:04 -04:00
Anuken
2f2dc01c6b Heal player cores on start 2021-06-05 09:49:00 -04:00
genNAowl
9f087214a1 Just a Few Small Changes to Status Effect Stat Displays (#5361)
* Messing Around with Status Effect Stats

* Longer, but cleaner and less buggy

Co-authored-by: Leonwang4234 <leonwang4234@gmail.com>
2021-06-05 09:01:38 -04:00
Anuken
6e05319424 Merge remote-tracking branch 'origin/master' 2021-06-05 08:57:30 -04:00
Anuken
151c4f13df Fixed #5362 2021-06-05 08:57:25 -04:00
Sharlotte
c6242fe7f1 [KO] Bleeding-Edge Bundle Update (#5352)
* [KO] Bleeding-Edge Bundle Update

* Update bundle_ko.properties
2021-06-04 20:28:07 -04:00
Anuken
7243ae4e95 Merge remote-tracking branch 'origin/master' 2021-06-04 20:19:15 -04:00
Anuken
3e636cba6b Finalized packr update 2021-06-04 20:19:11 -04:00
Volas171
5f28e26176 Add Mindustrypvp.ml to 7.0 BE list (#5360)
* yeet

* lol almost forgot that
2021-06-04 19:17:53 -04:00
Tegas Aziz
0a7d5b20c7 7.0 Indonesian Bundle (#5349)
* 7.0 Indonesian Bundles

* Update bundle_in_ID.properties

* small additions
2021-06-04 18:18:40 -04:00
Anuken
f9c48d0a02 WIP packr update 2021-06-04 17:32:53 -04:00
Anuken
dd9ec950be Faster payload blocks & voids 2021-06-04 13:14:21 -04:00
Anuken
a1cae3bc29 No timers for driver payloads 2021-06-04 11:52:27 -04:00
Anuken
944b9ae2cf No payload source power 2021-06-04 11:35:01 -04:00
Anuken
8ec62e9dba Duct bridge polish 2021-06-04 11:08:53 -04:00
Anuken
af676ea030 Merge remote-tracking branch 'origin/master' 2021-06-04 10:57:18 -04:00
Anuken
89fdda0ef6 Various minor bugfixes 2021-06-04 10:57:15 -04:00
Humanoid-X
4283f9f8d7 Update TechTree.java (#5357) 2021-06-04 10:56:22 -04:00
Anuken
527856e1b0 Mod dialog layout fixes 2021-06-04 09:48:31 -04:00
Anuken
1bbb52877f Let bullets have speed = 0 2021-06-04 08:53:39 -04:00
Anuken
6ceb1d5058 Merge remote-tracking branch 'origin/master' 2021-06-04 08:36:31 -04:00
Anuken
de9371f0bb Possible dexing error fix 2021-06-04 08:36:27 -04:00
genNAowl
b8daa422ee I Like Stats (#5347)
Co-authored-by: Leonwang4234 <leonwang4234@gmail.com>
2021-06-04 08:31:33 -04:00
Anuken
677bad5c60 Fixed #5348 2021-06-04 08:30:16 -04:00
Anuken
fcf1bdd701 Shock mine team region 2021-06-03 21:49:58 -04:00
Anuken
8fc61215a5 Show ducts 2021-06-03 21:37:58 -04:00
Anuken
6b33064196 Merge remote-tracking branch 'origin/master' 2021-06-03 19:49:49 -04:00
Anuken
c29d75f5d1 Fixed RailBulletType not dealing damage 2021-06-03 19:49:42 -04:00
Sharlotte
9f7568552f typo (#5021)
* typpppppo

* Update bundle_ko.properties
2021-06-03 19:16:08 -04:00
Anuken
00ca247d0f Inverse trig logic functions 2021-06-03 19:12:33 -04:00
Anuken
a2a4302c8c Merge remote-tracking branch 'origin/master' 2021-06-03 19:04:17 -04:00
Anuken
86ae13ed95 Improved Cyerce trails 2021-06-03 19:04:13 -04:00
Parkurist
a264a1cd65 Fixed 1 untranslated line (#5140) 2021-06-03 18:25:41 -04:00
Anuken
4932d11d7b Misc cleanup 2021-06-03 18:24:54 -04:00
Anuken
3f27cebfb6 Fire light 2021-06-03 16:09:32 -04:00
Anuken
9cd482d389 Minor bugfix 2021-06-03 16:01:51 -04:00
Anuken
c674b5c256 Merge remote-tracking branch 'origin/master' 2021-06-03 15:59:39 -04:00
Anuken
1c4184db4b Less respawn rubberbanding 2021-06-03 15:59:22 -04:00
QmelZ
0247301272 Custom Mass Driver Bullets (#5300)
* custom mass driver bullets

* ohno

* should be fixed now
2021-06-03 14:41:08 -04:00
VozDuh
1cbd58820e Fix For Metal Environments (#5322) 2021-06-03 14:36:55 -04:00
TranquillyUnpleasant
eb7e65668c Rotate slider in the mirror filter. (#5228)
* Rotate

* ToggleOption
2021-06-03 14:35:31 -04:00
Ngọc Lam
f91cc2eace Update Vietnamese Translation. (#5238)
* Update translation, fix some typo

* About 150 lines to do left.

* Typos fix #_1

* Typos fix + add trans

* Update to lastest commit.

* Base logic translation.

* a lot of typo ...

* some update from main bundle.

* Add more logic hint.

* Tracking update from main bundle.

* Translate some position.

Co-authored-by: EzLam <winbam1357@gmail.com>
2021-06-03 14:34:40 -04:00
Vanguard
942204bff1 [Bundle][RU] Update (#5028)
* double newline fix

hint.guardian

* 13 changed lines

mod.enabled
mod.disabled
status.burning.name
status.freezing.name
status.wet.name
status.melting.name
status.sapped.name
status.spore-slowed.name
status.tarred.name
status.overclock.name
status.shocked.name
status.blasted.name
status.unmoving.name

* yon't

* x'nt

* Update bundle_ru.properties

* 1 new, 1 changed

New:
stat.healing

Changed:
bullet.healpercent

Co-authored-by: Antsiferov Andrew <summet.dev@gmail.com>
2021-06-03 14:34:27 -04:00
kituta
43e13038f4 Update bundle_ja.properties (#5338) 2021-06-03 14:34:00 -04:00
genNAowl
6d28098180 Fix Boat Trails Being Drawn on Land (#5340)
* update

* Revert "update"

This reverts commit 6ff3523276.

* Hacky Implementation

* Revert "Hacky Implementation"

This reverts commit 632121312d.

* Not so Hacky Implementation

Co-authored-by: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com>
Co-authored-by: Leonwang4234 <leonwang4234@gmail.com>
Co-authored-by: Anuken <arnukren@gmail.com>
2021-06-03 14:31:23 -04:00
Anuken
f1cf1efe32 Build retry 2021-06-03 14:23:16 -04:00
Anuken
c345ad37b9 Merge remote-tracking branch 'origin/master' 2021-06-03 13:59:00 -04:00
Anuken
ac20b17e0b Mod bugfixes 2021-06-03 13:58:56 -04:00
OSP
a06ee52fb5 Add MinDurka v7 BE server. (#5341) 2021-06-03 13:26:45 -04:00
Anuken
41ccda03a8 Merge remote-tracking branch 'origin/master' 2021-06-03 12:27:08 -04:00
Anuken
3f7edc9018 Use BE servers instead of v6 2021-06-03 12:27:04 -04:00
Ahsoka-501
8f390468dc moved thedimas to C.A.M.S. (#5325) 2021-06-03 12:11:52 -04:00
Anuken
c6b4db8a4e arc 2021-06-03 11:41:14 -04:00
Anuken
978a5a80e3 arc 2021-06-03 11:40:18 -04:00
Anuken
c964704fe1 Merge remote-tracking branch 'origin/master' 2021-06-03 11:37:40 -04:00
Anuken
1313ed2761 Sprite packing fix 2021-06-03 11:37:33 -04:00
Somka000
4c5f27037b Add 7.0 server to BE list (#5336)
Co-authored-by: Anuken <arnukren@gmail.com>
2021-06-03 10:57:21 -04:00
RebornTrack970
bf17788485 Added an experimental V7 server to BE list (#5333) 2021-06-03 10:55:36 -04:00
ulwepo
c0dce6ca41 Update servers_v6.json (#5339)
This is a PVP server for Japanese.
2021-06-03 10:55:03 -04:00
Anuken
17873d93cc I am so sick of JITPack dying 2021-06-03 10:52:44 -04:00
Anuken
48c1421afe Further pack testing 2021-06-03 10:46:45 -04:00
Anuken
5d88dbf3b9 jitpack. 2021-06-03 10:32:54 -04:00
Anuken
91f472d88f jitpack. 2021-06-03 10:32:31 -04:00
Anuken
5533721f3c Added missing bundle/tech entries / Pack debug 2021-06-03 10:21:43 -04:00
Anuken
0c85a6ee47 Pack testing 2021-06-03 10:15:34 -04:00
Anuken
8128542a1f Trigger BE builds before tests 2021-06-03 09:52:45 -04:00
Anuken
7a93c21d10 Test: Disable antialiasing 2021-06-03 09:49:41 -04:00
Anuken
e248f44099 More bugfixes 2021-06-02 18:28:07 -04:00
Anuken
f854d0b1e6 Higher payload conveyor clip size 2021-06-02 18:21:37 -04:00
Anuken
fbe45aba74 Misc bugfixes 2021-06-02 17:44:57 -04:00
Anuken
79e079671c Triggering BE build 2021-06-02 17:08:32 -04:00
Anuken
4cd411d5ee Duct consistency 2021-06-02 17:07:08 -04:00
Anuken
9aae443e72 More netcode updates 2021-06-02 17:04:31 -04:00
Anuken
462a64bf21 Netcode updates 2021-06-02 16:51:52 -04:00
Anuken
eba6514fb5 #5329 without the weird indent 2021-06-02 14:54:03 -04:00
Anuken
1eebf0d270 Merge remote-tracking branch 'origin/master' 2021-06-02 12:52:57 -04:00
Anuken
dd7542032c Unnecessary Time.mark() 2021-06-02 12:52:49 -04:00
Anuken
5b8c4c4f8e Update README.md 2021-06-02 12:50:03 -04:00
Anuken
bab8c20f3b Update README.md 2021-06-02 12:49:33 -04:00
Anuken
662473936c Remove unused shader 2021-06-02 12:41:19 -04:00
Anuken
c9a1de1148 arc 2021-06-02 11:47:42 -04:00
Anuken
e16ce5b651 Removed BuildConfig import 2021-06-02 11:34:41 -04:00
Anuken
fa99a9b335 It's not even pre-alpha yet 2021-06-02 11:30:13 -04:00
Anuken
28b235ef07 Partial 7.0 merge - API preview 2021-06-02 11:08:08 -04:00
Romanin
ea75a357ca Update servers_v6.json (#5328)
Change RCR IP
2021-06-02 09:07:02 -04:00
genNAowl
60ceb63731 I would like to join contributor gang (#5327) 2021-06-02 08:51:55 -04:00
buthed010203
f5c8965616 ignore colors (#5324)
why isnt this already a thing
2021-06-01 12:50:11 -04:00
RebornTrack970
f42b147b06 Temporary Omega Server Change (#5321)
* Temporary Omega Server Change

* Added Rush and Castle Wars too

* Alright???

* Update servers_v6.json
2021-06-01 10:03:29 -04:00
Anuken
22b27dc168 Revert server move 2021-06-01 09:00:57 -04:00
MEEP of Faith
551ebb6b31 Wow I worded that terribly (#5320) 2021-05-31 17:49:37 -04:00
MEEP of Faith
8b95d2db0d Knockback following bullet direction (#5313) 2021-05-31 14:28:35 -04:00
Lrakotobe
b7c185ca1b correction of spelling mistakes (#5127) 2021-05-31 14:26:00 -04:00
RebornTrack970
8b50590cc5 Added Rapid and Testing Server (#5315)
(Testing server is a brand new idea, might get removed later on)
Rapid by Intervection.
2021-05-30 11:00:40 -04:00
MEEP of Faith
1ea4567912 Display Mass Driver range and reload stats (#5307)
* Display range and reload stats

* Unneeded
2021-05-29 08:43:34 -04:00
MEEP of Faith
dadbaa1380 e.rotation, 360f in randlLenVectors unneeded, remove them. (#5242) 2021-05-28 16:18:38 -04:00
buthed010203
0bf25cdd01 fix potential crash (#5305)
I dont think this can even happen without some plugins or mods but its better to be safe than sorry.
2021-05-28 13:27:20 -04:00
Thomas Widyantoko
2f07a21d66 Indonesian translation standardization (#5296)
* Indonesian bundle update

lenum.controller description and Tar Fields map

* translation bundle sync

* Indonesian translation standardization
2021-05-28 10:48:52 -04:00
MrDuck557
39d725d5ff Healing Status Effect Stat (#5304)
* Up

* Ground

* Healing

Very tiny change
2021-05-27 23:23:53 -04:00
NiChrosia
dd0b5f791c Add spawn function with Position argument to UnitType (#5293) 2021-05-26 19:37:33 -04:00
GaviTSRA
e3fdc1d57c Updated TSR Hub ip (#5297)
* Update servers_v6.json

* Update servers_v6.json

Changed TSR Hub ip
2021-05-26 14:40:17 -04:00
buthed010203
e22af83ed1 Fix a random disconnect (#5292)
This almost never happens but since the flood uses this method extensively, everyone gets disconnected every hour or so so I fixed it myself.
2021-05-25 15:34:33 -04:00
Darkness6030
265f38dcc6 Update MinDurka IP (#5284)
The biggest update of mindustry server ever! We've added SO many useful features, commands, new servers and more!
2021-05-23 11:25:07 -04:00
Anuken
008b2c57c5 Update LogicBlock.java 2021-05-22 13:30:05 -04:00
Anuken
256482a486 Update gradle.properties 2021-05-22 13:28:43 -04:00
MEEP of Faith
e4c434e26e lightningType follow angle (#5282)
* lightningType follow angle

* this is more complicated than it should be

time to make it less stupid
2021-05-22 08:41:04 -04:00
buthed010203
be71664436 Lower surge tower schem priority (#5277)
The priority of surge towers is now -15 (default for power nodes is -10). Schems with surge towers will often see them automatically connected to random buildings only a couple tiles away which are already in range of other nodes, the hope here is that this fixes that.
2021-05-20 12:33:40 -04:00
MEEP of Faith
db897d037d Unit Command Radius (#5269)
* Unit Command Radius

* Make effect change with radius

* Fix command center effect

* Display true radius
2021-05-19 14:34:57 -04:00
RebornTrack970
86d50e9147 Closed Backup 2r2t, reopened original 2r2t (#5273) 2021-05-19 13:48:29 -04:00
MEEP of Faith
0764fcb476 More random unit effects (#5272)
* More random fall smoke effects

* Do the same with status effects.
2021-05-19 08:25:28 -04:00
andrew3737
9a225d96ef 4 new Application Tests added (#5207) 2021-05-18 14:44:30 -04:00
SAMBUYYA
5eb80ead93 Update bundle_in_ID.properties (#5247)
* Update bundle_in_ID.properties

Adding and change some words. Menambah dan mengubah beberapa kata.

* Update bundle_in_ID.properties

* Update bundle_in_ID.properties

Third change. Perubahan ketiga.
2021-05-18 09:04:28 -04:00
Leonid Skorospelov
760962c2b4 Make CoreItemsDisplay not show up if nothing to show (#5263) 2021-05-17 14:10:05 -04:00
Leonid Skorospelov
b11b087d53 Do not reset mineTile of units to null client-side (#5252) 2021-05-16 13:52:03 -04:00
OSP
2d8b3918d2 Closed... (#5239) 2021-05-14 08:52:31 -04:00
BenMan95
6398fed47b Fixed logic controller updating (#5240) 2021-05-13 13:07:30 -04:00
Tegas Aziz
1e1d7d2e92 Add @SAMBUYYA on contributors (#5231)
@SAMBUYYA just translate Indonesian on pull #5230
2021-05-10 19:07:48 -04:00
SAMBUYYA
716fed08c3 Update bundle_in_ID.properties (#5230)
Mengubah dan menambahkan beberapa kata.
2021-05-10 17:05:43 -04:00
MEEP of Faith
6fcdb9d505 Draw flame over cracks (#5222) 2021-05-08 08:48:50 -04:00
MEEP of Faith
8d1a34b652 Include distance in foreshadow targetting (#5221)
* Include distance in foreshadow targetting

* Divide by larger number
2021-05-07 18:35:58 -04:00
TranquillyUnpleasant
ac8c81a0d5 Allow banned blocks to still be placeable within map editor. (#5212)
This makes it so you don't have to pointlessly unban and then re ban blocks while making maps.
2021-05-07 08:45:43 -04:00
Darkness6030
5f7e2d97ef Fixed minigames (now they are working) (#5209)
Oh yes
I have fixed minigames server
And TowerDefense, Crawler Arena and Siege are working well.
2021-05-06 15:00:53 -04:00
RebornTrack970
927077c54c Replaced 2r2t with Backup 2r2t (#5204)
The original 2r2t server is broken at the moment, replaced with backup one.
2021-05-06 10:01:30 -04:00
thedimas3007
a861da1a67 Update thedimas hub ip (#5201)
Sry for doing this again, but server was migrated to new, more powerfull host
2021-05-05 14:52:51 -04:00
Antsiferov Andrew
c53e14dd31 Fix crash when there's no sectors on planet (#5202)
`sectors.size - 1` is `-1` when there's no sectors on planet.
relevant crash log:
```
[E] java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 16
	at arc.struct.Seq.get(Seq.java:451)
	at mindustry.type.Planet.getLastSector(Planet.java:114)
	at mindustry.ui.dialogs.PlanetDialog.show(PlanetDialog.java:185)
        ...
        at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:36)
```
2021-05-05 14:51:35 -04:00
Tegas Aziz
622f735953 Update contributors (#5193) 2021-05-04 09:11:30 -04:00
MEEP of Faith
d820e7d31a Fix small linecast issue (#5192) 2021-05-03 22:10:36 -04:00
Thomas Widyantoko
0193d586d1 updated Indonesian translation (#4608)
* updated Indonesian translation

fixes and additions, structure descriptions are fixed and shortened

* Update bundle_in_ID.properties

logic tooltips and other fixes part 1

* Update bundle_in_ID.properties

logic tooltips and other fixes part 2

* Update: continue translating from me

* again and again

* Update bundle_in_ID.properties

logic tooltips and other fixes part 3

* Graphic Type Hint Translation 1

* Graphic Type Hint Translation 2

graphicstype.type translation

* Fix graphicstype.image typo

(Because no ones likes typo, isn't it?)

* Update bundle_in_ID.properties

logic tooltips and other fixes part 4

* Update bundle_in_ID.properties

logic tooltips and other fixes part 5 (last one)

Co-authored-by: Tegas Aziz <49786146+WilloIzCitron@users.noreply.github.com>
Co-authored-by: Anonymous Albert <44728043+TheMrAlbert@users.noreply.github.com>
2021-05-03 08:49:32 -04:00
Technisha Circuit
a56a0aa14f Currently not working due to technical difficulties (#5187) 2021-05-03 08:36:21 -04:00
Skat
7853767ee5 Fix plastanium conveyor linking (#5185) 2021-05-02 20:18:22 -04:00
Skat
9e519ab801 Add missed scarlet color (#5182) 2021-05-02 13:50:53 -04:00
Darkness6030
5995f0e215 Change MinDurka's ip address (#5180)
FINALLY WE HAVE EATEN DDOSERS, IT NOW WORKS!
2021-05-02 09:34:08 -04:00
Technisha Circuit
7f50969dbc Added jinxed.realms.us.to to the server list (#5177) 2021-04-30 14:10:26 -04:00
thedimas3007
76db20e410 Change thedimas hub IP (#5175)
@Anuken please merge it as soon as you can
2021-04-30 09:29:28 -04:00
MEEP of Faith
d9c5e5e08d No reason to hide ItemEntry (#5173) 2021-04-30 09:29:19 -04:00
Antsiferov Andrew
451568d5b2 Make Mod an abstract class (#5155) 2021-04-29 19:51:46 -04:00
MEEP of Faith
e8e23961f4 why toxopid cannon not in weapons folder (#5166) 2021-04-29 14:15:55 -04:00
Skat
0e1c4ccd6d Suggestions for unknown command response (#5165) 2021-04-29 13:11:51 -04:00
OSP
73f0593acf IP change MinDefence (#5164)
I hope the last change of the ip.
2021-04-29 10:18:36 -04:00
Darkness6030
b779ec3759 Add a domain name to MinDurka. (#5159) 2021-04-27 20:55:10 -04:00
Skat
41423d43bb Dont try load mod icons on server (#5160) 2021-04-27 10:24:30 -04:00
MEEP of Faith
7dc3dfd29e e.checkTarget is shorter (#5157) 2021-04-26 15:22:33 -04:00
Leonid Skorospelov
6eea8bebdf Actually sync ItemTurret's ammo (#5154) 2021-04-25 09:06:45 -04:00
Darkness6030
8cd7e1c307 Update MinDefense Ip address (#5147)
@osp54 forgot to update it, so i made it :-/
2021-04-24 17:24:25 -04:00
MEEP of Faith
3910d7769b Add space to bullet.lightning (#5136) 2021-04-22 11:11:08 -04:00
Anuken
f22f5a8ad9 ... 2021-04-20 21:07:46 -04:00
Anuken
f14d4d91b0 why does this work locally 2021-04-20 21:01:56 -04:00
Anuken
fc68a8af19 ???? 2021-04-20 20:58:04 -04:00
Anuken
0c3e110326 Update build.gradle 2021-04-20 20:50:10 -04:00
Anuken
434ee7de97 Create SStats.java 2021-04-20 08:28:09 -04:00
Anuken
6e1880f409 Update SStats.java 2021-04-20 08:28:00 -04:00
Anuken
e8fa899c40 Update SStats.java 2021-04-20 08:24:06 -04:00
Anuken
d9b2f4ae67 Update SStats.java 2021-04-20 08:20:02 -04:00
ThePythonGuy
137792131e Fix Tetrative Reconstructor's sprite odd 1-pixel error (#5119)
* Create e

* Delete e

* Add files via upload
2021-04-17 12:53:57 -04:00
MEEP of Faith
fbddc0abc9 Turn MiningRange into a UnitType variable. (#5112)
* Turn MiningRange into a UnitType variable.

Long range mining go brrrrr

* Anuke Approved
2021-04-16 20:57:40 -04:00
NiChrosia
d9b6ada0b3 Replace 'sattelite' with 'satellite' (#5110) 2021-04-15 17:00:35 -04:00
Drullkus
f005b83ed3 Make PathCost interface public (#5109) 2021-04-15 09:27:02 -04:00
OSP
d41362a71d Create Mindustry Defence category (#5095)
* Create Mindustry Defence category

End add new server Tower Defence PvP, it is not working now, but it will work soon

* Update servers_v6.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>
Co-authored-by: Anuken <arnukren@gmail.com>
2021-04-12 22:29:58 -04:00
Slava0135
6cfb88a2e8 redundant field in DrillBuild (#5101) 2021-04-12 15:18:55 -04:00
BlueWolf
865d0082cc Sand water (#5100) 2021-04-12 14:02:00 -04:00
Darkness6030
24c8d6e040 Add Minigames HUB to global server list (#5097)
This is a hub of all MinDurka minigames
We have:
1) Castle Wars (by Xusk)
2) Tower Defense
3) MS:GO (by Xusk)
4) Zone Capture (by Misaka)
5) The Siege (by OSP, the gamemode belongs to Mindustry.defense)
Soon we'll add some gamemodes like Crawler Arena
2021-04-12 12:11:34 -04:00
Skat
a55039447a Add file name printing (#5093) 2021-04-11 09:26:47 -04:00
Drullkus
aef7709764 Added addUpgrade method to Reconstructor to avoid dealing with array creation in Rhino JS (#5094) 2021-04-10 21:28:28 -04:00
BasedUser
c99b79762a they have a n a m e (#5074) 2021-04-10 20:15:12 -04:00
MEEP of Faith
0d8f95354f Move damage and knockback to hitEntity (#5000)
* Move damge and knockback to `hitEntity`

* b.damage, not damage
2021-04-10 09:15:34 -04:00
MEEP of Faith
7e7e6b70e2 Randomly Rotated Particle Weather Particles (#5020) 2021-04-10 09:12:51 -04:00
MEEP of Faith
56b8986a0b Unit Sprite Heresyn't (#5084) 2021-04-08 15:56:22 -04:00
Qiyi Shan
3b8aa0484e Fixed a typo (#5081)
Fixed a typo that swaps description of drawFlush/printFlush
2021-04-08 11:29:56 -04:00
Elvys Soares
2b9d516922 Refactored duplicated tests into a parameterized one (#5077)
* Added test parameters to avoid code duplication

Signed-off-by: Elvys Soares <eas5@cin.ufpe.br>

* Added test parameters to avoid code duplication and updated JUnit to 5.7.1 version

Signed-off-by: Elvys Soares <eas5@cin.ufpe.br>
2021-04-08 10:25:48 -04:00
MEEP of Faith
bdf958ed17 Copy ItemStack functions over to LiquidStack (#5080) 2021-04-08 10:05:37 -04:00
Arik
5fc4e1f5a5 Black Bar Fix (#5079) 2021-04-07 21:07:08 -04:00
MEEP of Faith
24f0a17395 Crawlers do not explode from their center (#5078) 2021-04-07 18:48:34 -04:00
RebornTrack970
08d200e1fa Moved 2r2t (#5066)
Now 2r2t is a mindustry host instead of mc.
2021-04-06 18:08:06 -04:00
Somka000
782442f144 Add .pl server to public list (#5069)
Minigame server
2021-04-06 15:55:11 -04:00
buthed010203
7e6f3e3761 Update pr.yml (#5067) 2021-04-06 11:50:49 -04:00
Anuken
6f8d43bc78 typo fix 2021-04-04 12:36:19 -04:00
MEEP of Faith
ad46fa93a5 Ignore VSCode settings (#5054) 2021-04-03 20:39:56 -04:00
Anuken
4fec3bfcf9 PR typo fix 2021-04-03 11:42:47 -04:00
Anuken
ef49a16c9e Use core/src for kotlin source 2021-04-03 11:31:41 -04:00
Anuken
93f3d6039e Excluded comp** from final jar 2021-04-03 11:15:41 -04:00
Anuken
19778c743c Fewer methods 2021-04-03 01:28:19 -04:00
Anuken
28a2e7c697 Kotlin support fixes 2021-04-03 00:59:57 -04:00
Max Leibowitz
d538e63c4c :) 2021-04-02 17:26:58 -07:00
Max Leibowitz
31f8d6c830 Move to kapt for annotation processing (allows kotlin to be used in the core module) 2021-04-02 17:25:07 -07:00
GaviTSRA
02e68d27a3 Added TSR Hub to serverlist (#4965)
* Added TSR Hub to serverlist

* Update servers_v6.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>

* Update servers_v6.json

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>

* Updated hub ip

Co-authored-by: Patrick 'Quezler' Mounier <Quezler@me.com>
2021-04-02 10:37:58 -04:00
Anuken
0aa2d5f18c Merge remote-tracking branch 'origin/master' 2021-04-01 09:27:43 -04:00
Anuken
5a5854420e Long support for UI.formatAmount 2021-04-01 09:27:36 -04:00
TranquillyUnpleasant
6a8127e7cd un-escape \n for string configs. (#5042)
Currently it escapes them to a literal text, making multi line messages impossible.
2021-04-01 09:14:20 -04:00
Anuken
1bd4c96ee8 Power node placement fixes 2021-03-31 22:36:46 -04:00
Anuken
d66d7e09e3 Explosion damage tweaks 2021-03-31 13:28:08 -04:00
Anuken
e85e43c162 Disable blending when drawing displays 2021-03-31 11:18:17 -04:00
Anuken
dee020bd71 Merge remote-tracking branch 'origin/master' 2021-03-31 09:52:35 -04:00
Anuken
d548a11c60 Skip invalid lobbies 2021-03-31 09:52:31 -04:00
RebornTrack970
59bf2e3571 Updated Server Omega (#5031)
Moved Expansion and fixed immesureable ping.
2021-03-31 09:46:14 -04:00
Anuken
6ebabbb56a Fixed local games sometimes not being found on Steam 2021-03-31 09:42:44 -04:00
Anuken
179cedd6cc Merge remote-tracking branch 'origin/master' 2021-03-30 20:58:20 -04:00
Anuken
3b56f36bbd Fixed #5029 2021-03-30 20:58:13 -04:00
buthed010203
be0765f5ea Radar shouldn't sense derelict as enemies (#5027)
Turrets no longer shoot derelict units by default, they shouldn't be sensed as enemies if this is the case.
2021-03-30 11:58:53 -04:00
Anuken
1715741e37 arc 2021-03-30 11:06:39 -04:00
Anuken
aaa41fbf72 copyNatives before iOS copyAssets 2021-03-30 10:42:51 -04:00
Anuken
2096d006be Merge remote-tracking branch 'origin/master' 2021-03-30 10:24:57 -04:00
Anuken
e455f7d170 Fixed #5025 2021-03-30 10:24:53 -04:00
MEEP of Faith
7a0e772a05 Remove space between damage and /sec (#5024) 2021-03-30 10:22:08 -04:00
Anuken
7f3b8f7e56 jitpack is dead 2021-03-29 20:35:07 -04:00
Anuken
5a493ebf0e arc 2021-03-29 19:05:55 -04:00
Anuken
70bcb0a940 copyNatives task for iOS 2021-03-29 18:33:03 -04:00
Anuken
3105478328 Merge remote-tracking branch 'origin/master' 2021-03-29 15:06:21 -04:00
Anuken
ae8833e679 Fixed rare schematic crash 2021-03-29 15:06:06 -04:00
Anuken
4a9eeeeac3 Merge branch 'master' of https://github.com/Anuken/Mindustry 2021-03-28 19:56:20 -04:00
Anuken
de458f5c26 Cleanup 2021-03-28 10:57:06 -04:00
Anuken
db931bace2 Cleanup 2021-03-28 10:56:19 -04:00
666 changed files with 19255 additions and 9439 deletions

View File

@@ -6,15 +6,15 @@ on:
- 'v*' - 'v*'
jobs: jobs:
buildJava14: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 14 - name: Set up JDK 16
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 14 java-version: 16
- name: Set env - name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Add Arc release - name: Add Arc release
@@ -47,7 +47,7 @@ jobs:
git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
cd ../MindustryBuilds cd ../MindustryBuilds
echo "Updating version to ${RELEASE_VERSION:1}" echo "Updating version to ${RELEASE_VERSION:1}"
echo versionName=6-fdroid-${RELEASE_VERSION:1}$'\n'versionCode=${RELEASE_VERSION:1} > version_fdroid.txt echo versionName=7-fdroid-${RELEASE_VERSION:1}$'\n'versionCode=${GITHUB_RUN_NUMBER} > version_fdroid.txt
git add . git add .
git commit -m "Updating to build ${RELEASE_VERSION:1}" git commit -m "Updating to build ${RELEASE_VERSION:1}"
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds

View File

@@ -1,17 +1,17 @@
name: Pull Request Tests name: Pull Request Tests
on: [pull_request] on: [pull_request, workflow_dispatch]
jobs: jobs:
buildJava14: testPR:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 14 - name: Set up JDK 16
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 14 java-version: 16
- name: Run unit tests and build JAR - name: Run unit tests and build JAR
run: ./gradlew test desktop:dist run: ./gradlew test desktop:dist
- name: Upload desktop JAR for testing - name: Upload desktop JAR for testing

View File

@@ -3,17 +3,11 @@ name: Tests
on: [push, workflow_dispatch] on: [push, workflow_dispatch]
jobs: jobs:
buildJava14: runPush:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Run unit tests
run: ./gradlew clean cleanTest test
- name: Trigger BE build - name: Trigger BE build
if: ${{ github.repository == 'Anuken/Mindustry' }} if: ${{ github.repository == 'Anuken/Mindustry' }}
run: | run: |
@@ -23,3 +17,9 @@ jobs:
git tag ${BNUM} git tag ${BNUM}
git config --global user.name "Build Uploader" git config --global user.name "Build Uploader"
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${BNUM} git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${BNUM}
- name: Set up JDK 16
uses: actions/setup-java@v1
with:
java-version: 16
- name: Run unit tests
run: ./gradlew clean cleanTest test

4
.gitignore vendored
View File

@@ -102,6 +102,10 @@ com_crashlytics_export_strings.xml
.externalToolBuilders/ .externalToolBuilders/
*.launch *.launch
## VSCode
.vscode/
## NetBeans ## NetBeans
/nbproject/private/ /nbproject/private/

View File

@@ -26,7 +26,7 @@ This means:
- `camelCase`, **even for constants or enums**. Why? Because `SCREAMING_CASE` is ugly, annoying to type and does not achieve anything useful. Constants are *less* dangerous than variables, not more. Any reasonable IDE should highlight them for you anyway. - `camelCase`, **even for constants or enums**. Why? Because `SCREAMING_CASE` is ugly, annoying to type and does not achieve anything useful. Constants are *less* dangerous than variables, not more. Any reasonable IDE should highlight them for you anyway.
- No underscores for anything. (Yes, I know `Bindings` violates this principle, but that's for legacy reasons and really should be cleaned up some day) - No underscores for anything. (Yes, I know `Bindings` violates this principle, but that's for legacy reasons and really should be cleaned up some day)
- Do not use braceless `if/else` statements. `if(x) statement else statement2` should **never** be done. In very specific situations, having braceless if-statements on one line is allowed: `if(cond) return;` would be valid. - Do not use braceless `if/else` statements. `if(x) statement else statement2` should **never** be done. In very specific situations, having braceless if-statements on one line is allowed: `if(cond) return;` would be valid.
- Prefer single-line javadoc `/** @return for example */` instead of multiline javadoc whenver possible - Prefer single-line javadoc `/** @return for example */` instead of multiline javadoc whenever possible
- Short method/variable names (multipleLongWords should be avoided if it's possible to do so reasonably, especially for variables) - Short method/variable names (multipleLongWords should be avoided if it's possible to do so reasonably, especially for variables)
- Use wildcard imports - `import some.package.*` - for everything. This makes incorrect class usage more obvious (*e.g. arc.util.Timer vs java.util.Timer*) and leads to cleaner-looking code. - Use wildcard imports - `import some.package.*` - for everything. This makes incorrect class usage more obvious (*e.g. arc.util.Timer vs java.util.Timer*) and leads to cleaner-looking code.

View File

@@ -18,7 +18,7 @@ See [CONTRIBUTING](CONTRIBUTING.md).
Bleeding-edge builds are generated automatically for every commit. You can see them [here](https://github.com/Anuken/MindustryBuilds/releases). Bleeding-edge builds are generated automatically for every commit. You can see them [here](https://github.com/Anuken/MindustryBuilds/releases).
If you'd rather compile on your own, follow these instructions. If you'd rather compile on your own, follow these instructions.
First, make sure you have [JDK 14](https://adoptopenjdk.net/) installed. Open a terminal in the root directory, `cd` to the Mindustry folder and run the following commands: First, make sure you have [JDK 16](https://adoptopenjdk.net/archive.html?variant=openjdk16&jvmVariant=hotspot) installed. **Other JDK versions will not work.** Open a terminal in the Mindustry directory and run the following commands:
### Windows ### Windows

View File

@@ -17,7 +17,7 @@
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:appCategory="game" android:appCategory="game"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/ArcTheme" android:fullBackupContent="@xml/backup_rules"> android:fullBackupContent="@xml/backup_rules">
<meta-data android:name="android.max_aspect" android:value="2.1"/> <meta-data android:name="android.max_aspect" android:value="2.1"/>
<activity <activity
android:name="mindustry.android.AndroidLauncher" android:name="mindustry.android.AndroidLauncher"

View File

@@ -7,9 +7,7 @@ buildscript{
} }
dependencies{ dependencies{
//IMPORTANT NOTICE: any version of the plugin after 3.4.1 will break builds classpath 'com.android.tools.build:gradle:7.1.0-alpha02'
//it appears abstract methods don't get desugared properly (if at all)
classpath 'com.android.tools.build:gradle:3.4.1'
} }
} }
@@ -20,35 +18,20 @@ configurations{ natives }
repositories{ repositories{
mavenCentral() mavenCentral()
maven{ url "https://maven.google.com" } maven{ url "https://maven.google.com" }
jcenter() //remove later once google fixes the dependency jcenter() //remove later once google/JetBrains fixes the dependency
}
dependencies{
implementation project(":core")
implementation arcModule("backends:backend-android")
implementation 'com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3'
natives "com.github.Anuken.Arc:natives-android:${getArcHash()}"
natives "com.github.Anuken.Arc:natives-freetype-android:${getArcHash()}"
natives "com.github.Anuken.Arc:natives-box2d-android:${getArcHash()}"
//android dependencies magically disappear during compilation, thanks gradle!
def sdkFile = new File((String)findSdkDir(), "/platforms/android-29/android.jar")
if(sdkFile.exists()) compileOnly files(sdkFile.absolutePath)
} }
task deploy(type: Copy){ task deploy(type: Copy){
dependsOn "assembleRelease" dependsOn "assembleRelease"
from "build/outputs/apk/release/android-release.apk" from "build/outputs/apk/standard/release/android-standard-release.apk"
into "../deploy/" into "../deploy/"
rename("android-release.apk", "${generateDeployName('android')}.apk") rename("android-standard-release.apk", "${generateDeployName('android')}.apk")
} }
android{ android{
buildToolsVersion '29.0.3' buildToolsVersion '30.0.2'
compileSdkVersion 29 compileSdkVersion 30
sourceSets{ sourceSets{
main{ main{
manifest.srcFile 'AndroidManifest.xml' manifest.srcFile 'AndroidManifest.xml'
@@ -59,9 +42,13 @@ android{
assets.srcDirs = ['assets', 'src/main/assets', '../core/assets/'] assets.srcDirs = ['assets', 'src/main/assets', '../core/assets/']
jniLibs.srcDirs = ['libs'] jniLibs.srcDirs = ['libs']
} }
gp{
java.srcDirs = ['srcgp']
}
androidTest.setRoot('tests') androidTest.setRoot('tests')
} }
packagingOptions{ packagingOptions{
exclude 'META-INF/robovm/ios/robovm.xml' exclude 'META-INF/robovm/ios/robovm.xml'
} }
@@ -73,7 +60,7 @@ android{
applicationId "io.anuke.mindustry" applicationId "io.anuke.mindustry"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 29 targetSdkVersion 30
versionName versionNameResult versionName versionNameResult
versionCode = (System.getenv("TRAVIS_BUILD_ID") != null ? System.getenv("TRAVIS_BUILD_ID").toInteger() : vcode) versionCode = (System.getenv("TRAVIS_BUILD_ID") != null ? System.getenv("TRAVIS_BUILD_ID").toInteger() : vcode)
@@ -109,6 +96,14 @@ android{
} }
} }
buildTypes{
all{
minifyEnabled = true
shrinkResources = true
proguardFiles("proguard-rules.pro")
}
}
if(project.hasProperty("RELEASE_STORE_FILE") || System.getenv("CI") == "true"){ if(project.hasProperty("RELEASE_STORE_FILE") || System.getenv("CI") == "true"){
buildTypes{ buildTypes{
release{ release{
@@ -116,10 +111,37 @@ android{
} }
} }
} }
// Specifies one flavor dimension.
flavorDimensions "version"
productFlavors{
standard{
}
gp{
applicationIdSuffix ".gp"
versionNameSuffix "-gp"
}
}
} }
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders dependencies{
// so they get packed with the APK. implementation project(":core")
implementation arcModule("backends:backend-android")
implementation 'com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3'
natives "com.github.Anuken.Arc:natives-android:${getArcHash()}"
natives "com.github.Anuken.Arc:natives-freetype-android:${getArcHash()}"
gpImplementation "com.google.android.gms:play-services-games:21.0.0"
gpImplementation "com.google.android.gms:play-services-auth:19.0.0"
//android dependencies magically disappear during compilation, thanks gradle!
def sdkFile = new File((String)findSdkDir(), "/platforms/android-29/android.jar")
if(sdkFile.exists()) compileOnly files(sdkFile.absolutePath)
}
task copyAndroidNatives(){ task copyAndroidNatives(){
configurations.natives.files.each{ jar -> configurations.natives.files.each{ jar ->
copy{ copy{
@@ -131,29 +153,13 @@ task copyAndroidNatives(){
} }
task run(type: Exec){ task run(type: Exec){
def path commandLine "${findSdkDir()}/platform-tools/adb", 'shell', 'am', 'start', '-n', 'io.anuke.mindustry/mindustry.android.AndroidLauncher'
def localProperties = project.file("../local.properties")
if(localProperties.exists()){
Properties properties = new Properties()
localProperties.withInputStream{ instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if(sdkDir){
path = sdkDir
}else{
path = "$System.env.ANDROID_HOME"
}
}else{
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'io.anuke.mindustry/mindustry.android.AndroidLauncher'
} }
if(!project.ext.hasSprites()){ if(!project.ext.hasSprites()){
println "Scheduling sprite pack." tasks.whenTaskAdded{ task ->
run.dependsOn ":tools:pack" if(task.name == 'assembleDebug' || task.name == 'assembleRelease'){
deploy.dependsOn ":tools:pack" task.dependsOn ":tools:pack"
}
}
} }

9
android/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,9 @@
-dontobfuscate
#these are essential packages that should not be "optimized" in any way
#the main purpose of d8 here is to shrink the absurdly-large google play games libraries
-keep class mindustry.** { *; }
-keep class arc.** { *; }
-keep class net.jpountz.** { *; }
-keep class rhino.** { *; }
-keep class com.android.dex.** { *; }

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ArcTheme" parent="android:Theme.Material.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>

View File

@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Mindustry</string> <string name="app_name">Mindustry</string>
</resources> </resources>

View File

@@ -1,12 +0,0 @@
<resources>
<style name="ArcTheme" parent="android:Theme">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>

View File

@@ -33,6 +33,9 @@ public class AndroidLauncher extends AndroidApplication{
FileChooser chooser; FileChooser chooser;
Runnable permCallback; Runnable permCallback;
Object gpService;
Class<?> serviceClass;
@Override @Override
protected void onCreate(Bundle savedInstanceState){ protected void onCreate(Bundle savedInstanceState){
UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler(); UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
@@ -50,7 +53,7 @@ public class AndroidLauncher extends AndroidApplication{
}); });
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if(doubleScaleTablets && isTablet(this.getContext())){ if(doubleScaleTablets && isTablet(this)){
Scl.setAddition(0.5f); Scl.setAddition(0.5f);
} }
@@ -63,7 +66,7 @@ public class AndroidLauncher extends AndroidApplication{
@Override @Override
public rhino.Context getScriptContext(){ public rhino.Context getScriptContext(){
return AndroidRhinoContext.enter(getContext().getCacheDir()); return AndroidRhinoContext.enter(getCacheDir());
} }
@Override @Override
@@ -71,8 +74,28 @@ public class AndroidLauncher extends AndroidApplication{
} }
@Override @Override
public ClassLoader loadJar(Fi jar, String mainClass) throws Exception{ public ClassLoader loadJar(Fi jar, ClassLoader parent) throws Exception{
return new DexClassLoader(jar.file().getPath(), getFilesDir().getPath(), null, getClassLoader()); return new DexClassLoader(jar.file().getPath(), getFilesDir().getPath(), null, parent){
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException{
//check for loaded state
Class<?> loadedClass = findLoadedClass(name);
if(loadedClass == null){
try{
//try to load own class first
loadedClass = findClass(name);
}catch(ClassNotFoundException | NoClassDefFoundError e){
//use parent if not found
return parent.loadClass(name);
}
}
if(resolve){
resolveClass(loadedClass);
}
return loadedClass;
}
};
} }
@Override @Override
@@ -165,9 +188,20 @@ public class AndroidLauncher extends AndroidApplication{
try{ try{
//new external folder //new external folder
Fi data = Core.files.absolute(getContext().getExternalFilesDir(null).getAbsolutePath()); Fi data = Core.files.absolute(((Context)this).getExternalFilesDir(null).getAbsolutePath());
Core.settings.setDataDirectory(data); Core.settings.setDataDirectory(data);
//delete unused cache folder to free up space
try{
Fi cache = Core.settings.getDataDirectory().child("cache");
if(cache.exists()){
cache.deleteDirectory();
}
}catch(Throwable t){
Log.err("Failed to delete cached folder", t);
}
//move to internal storage if there's no file indicating that it moved //move to internal storage if there's no file indicating that it moved
if(!Core.files.local("files_moved").exists()){ if(!Core.files.local("files_moved").exists()){
Log.info("Moving files to external storage..."); Log.info("Moving files to external storage...");
@@ -209,6 +243,24 @@ public class AndroidLauncher extends AndroidApplication{
} }
} }
@Override
public void onResume(){
super.onResume();
//TODO enable once GPGS is set up on the GP console
if(false && getPackageName().endsWith(".gp")){
try{
if(gpService == null){
serviceClass = Class.forName("mindustry.android.GPGameService");
gpService = serviceClass.getConstructor().newInstance();
}
serviceClass.getMethod("onResume", Context.class).invoke(gpService, this);
}catch(Exception e){
Log.err("Failed to update Google Play Services", e);
}
}
}
private void checkFiles(Intent intent){ private void checkFiles(Intent intent){
try{ try{
Uri uri = intent.getData(); Uri uri = intent.getData();

View File

@@ -13,6 +13,7 @@ import com.android.dx.dex.cf.*;
import com.android.dx.dex.file.DexFile; import com.android.dx.dex.file.DexFile;
import com.android.dx.merge.*; import com.android.dx.merge.*;
import dalvik.system.*; import dalvik.system.*;
import mindustry.mod.*;
import rhino.*; import rhino.*;
import java.io.*; import java.io.*;
@@ -30,23 +31,6 @@ public class AndroidRhinoContext{
* @return a context prepared for android * @return a context prepared for android
*/ */
public static Context enter(File cacheDirectory){ public static Context enter(File cacheDirectory){
if(!SecurityController.hasGlobal())
SecurityController.initGlobal(new SecurityController(){
@Override
public GeneratedClassLoader createClassLoader(ClassLoader classLoader, Object o){
return Context.getCurrentContext().createClassLoader(classLoader);
}
@Override
public Object getDynamicSecurityDomain(Object o){
return null;
}
@Override
public Object callWithDomain(Object o, Context context, Callable callable, Scriptable scriptable, Scriptable scriptable1, Object[] objects){
return null;
}
});
AndroidContextFactory factory; AndroidContextFactory factory;
if(!ContextFactory.hasExplicitGlobal()){ if(!ContextFactory.hasExplicitGlobal()){
@@ -175,7 +159,7 @@ public class AndroidRhinoContext{
}catch(IOException e){ }catch(IOException e){
e.printStackTrace(); e.printStackTrace();
} }
android.content.Context context = ((AndroidApplication) Core.app).getContext(); android.content.Context context = (android.content.Context)((AndroidApplication)Core.app);
return new DexClassLoader(dexFile.getPath(), VERSION.SDK_INT >= 21 ? context.getCodeCacheDir().getPath() : context.getCacheDir().getAbsolutePath(), null, getParent()).loadClass(name); return new DexClassLoader(dexFile.getPath(), VERSION.SDK_INT >= 21 ? context.getCodeCacheDir().getPath() : context.getCacheDir().getAbsolutePath(), null, getParent()).loadClass(name);
} }

View File

@@ -0,0 +1,40 @@
package mindustry.android;
import android.content.*;
import arc.util.*;
import com.google.android.gms.auth.api.signin.*;
import com.google.android.gms.games.*;
import mindustry.service.*;
public class GPGameService extends GameService{
private GoogleSignInAccount account;
public void onResume(Context context){
Log.info("[GooglePlayService] Resuming.");
GoogleSignInAccount current = GoogleSignIn.getLastSignedInAccount(context);
GoogleSignInOptions options =
new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
.requestScopes(Games.SCOPE_GAMES_SNAPSHOTS)
.build();
if(GoogleSignIn.hasPermissions(current, options.getScopeArray())){
this.account = current;
Log.info("Already signed in to Google Play Games.");
}else{
GoogleSignIn.getClient(context, options).silentSignIn().addOnCompleteListener(complete -> {
if(!complete.isSuccessful()){
if(complete.getException() != null){
Log.err("Failed to sign in to Google Play Games.", complete.getException());
}else{
Log.warn("Failed to sign in to Google Play Games.");
}
}else{
this.account = complete.getResult();
Log.info("Signed in to Google Play Games.");
}
});
}
}
}

View File

@@ -118,7 +118,7 @@ public class Annotations{
/** /**
* The region name to load. Variables can be used: * The region name to load. Variables can be used:
* "@" -> block name * "@" -> block name
* "$size" -> block size * "@size" -> block size
* "#" "#1" "#2" -> index number, for arrays * "#" "#1" "#2" -> index number, for arrays
* */ * */
String value(); String value();
@@ -177,12 +177,12 @@ public class Annotations{
//region remote //region remote
public enum PacketPriority{ public enum PacketPriority{
/** Does not get handled unless client is connected. */
low,
/** Gets put in a queue and processed if not connected. */ /** Gets put in a queue and processed if not connected. */
normal, normal,
/** Gets handled immediately, regardless of connection status. */ /** Gets handled immediately, regardless of connection status. */
high, high,
/** Does not get handled unless client is connected. */
low
} }
/** A set of two booleans, one specifying server and one specifying client. */ /** A set of two booleans, one specifying server and one specifying client. */

View File

@@ -2,15 +2,10 @@ package mindustry.annotations;
import arc.files.*; import arc.files.*;
import arc.struct.*; import arc.struct.*;
import arc.util.Log;
import arc.util.Log.*;
import arc.util.*; import arc.util.*;
import arc.util.Log.*;
import com.squareup.javapoet.*; import com.squareup.javapoet.*;
import com.sun.source.util.*; import com.sun.source.util.*;
import com.sun.tools.javac.model.*;
import com.sun.tools.javac.processing.*;
import com.sun.tools.javac.tree.*;
import com.sun.tools.javac.util.*;
import mindustry.annotations.util.*; import mindustry.annotations.util.*;
import javax.annotation.processing.*; import javax.annotation.processing.*;
@@ -22,7 +17,6 @@ import javax.tools.Diagnostic.*;
import javax.tools.*; import javax.tools.*;
import java.io.*; import java.io.*;
import java.lang.annotation.*; import java.lang.annotation.*;
import java.util.List;
import java.util.*; import java.util.*;
@SupportedSourceVersion(SourceVersion.RELEASE_8) @SupportedSourceVersion(SourceVersion.RELEASE_8)
@@ -31,19 +25,16 @@ public abstract class BaseProcessor extends AbstractProcessor{
public static final String packageName = "mindustry.gen"; public static final String packageName = "mindustry.gen";
public static Types typeu; public static Types typeu;
public static JavacElements elementu; public static Elements elementu;
public static Filer filer; public static Filer filer;
public static Messager messager; public static Messager messager;
public static Trees trees; public static Trees trees;
public static TreeMaker maker;
protected int round; protected int round;
protected int rounds = 1; protected int rounds = 1;
protected RoundEnvironment env; protected RoundEnvironment env;
protected Fi rootDirectory; protected Fi rootDirectory;
protected Context context;
public static String getMethodName(Element element){ public static String getMethodName(Element element){
return ((TypeElement)element.getEnclosingElement()).getQualifiedName().toString() + "." + element.getSimpleName(); return ((TypeElement)element.getEnclosingElement()).getQualifiedName().toString() + "." + element.getSimpleName();
} }
@@ -186,7 +177,7 @@ public abstract class BaseProcessor extends AbstractProcessor{
Log.err("[CODEGEN ERROR] " + message + ": " + elem); Log.err("[CODEGEN ERROR] " + message + ": " + elem);
} }
public void err(String message, Selement elem){ public static void err(String message, Selement elem){
err(message, elem.e); err(message, elem.e);
} }
@@ -194,15 +185,11 @@ public abstract class BaseProcessor extends AbstractProcessor{
public synchronized void init(ProcessingEnvironment env){ public synchronized void init(ProcessingEnvironment env){
super.init(env); super.init(env);
JavacProcessingEnvironment javacProcessingEnv = (JavacProcessingEnvironment)env;
trees = Trees.instance(env); trees = Trees.instance(env);
typeu = env.getTypeUtils(); typeu = env.getTypeUtils();
elementu = javacProcessingEnv.getElementUtils(); elementu = env.getElementUtils();
filer = env.getFiler(); filer = env.getFiler();
messager = env.getMessager(); messager = env.getMessager();
context = ((JavacProcessingEnvironment)env).getContext();
maker = TreeMaker.instance(javacProcessingEnv.getContext());
Log.level = LogLevel.info; Log.level = LogLevel.info;
@@ -219,7 +206,7 @@ public abstract class BaseProcessor extends AbstractProcessor{
String path = Fi.get(filer.getResource(StandardLocation.CLASS_OUTPUT, "no", "no") String path = Fi.get(filer.getResource(StandardLocation.CLASS_OUTPUT, "no", "no")
.toUri().toURL().toString().substring(OS.isWindows ? 6 : "file:".length())) .toUri().toURL().toString().substring(OS.isWindows ? 6 : "file:".length()))
.parent().parent().parent().parent().parent().parent().parent().toString().replace("%20", " "); .parent().parent().parent().parent().parent().parent().parent().toString().replace("%20", " ");
rootDirectory = Fi.get(path); rootDirectory = Fi.get(path).parent();
}catch(IOException e){ }catch(IOException e){
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@@ -143,6 +143,7 @@ public class EntityIO{
if(sl) cont("if(!islocal)"); if(sl) cont("if(!islocal)");
if(sf){ if(sf){
//TODO adding + targetSuf to the assignment fixes units being interpolated incorrectly during physics, but makes interpolation snap instead.
st(field.name + lastSuf + " = this." + field.name); st(field.name + lastSuf + " = this." + field.name);
} }

View File

@@ -132,6 +132,7 @@ public class EntityProcess extends BaseProcessor{
.build())).addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).build()); .build())).addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).build());
} }
//generate interface getters and setters for all "standard" fields
for(Svar field : component.fields().select(e -> !e.is(Modifier.STATIC) && !e.is(Modifier.PRIVATE) && !e.has(Import.class))){ for(Svar field : component.fields().select(e -> !e.is(Modifier.STATIC) && !e.is(Modifier.PRIVATE) && !e.has(Import.class))){
String cname = field.name(); String cname = field.name();
@@ -273,7 +274,10 @@ public class EntityProcess extends BaseProcessor{
name += "Entity"; name += "Entity";
} }
if(ann.legacy()){ boolean legacy = ann.legacy();
if(legacy){
baseClass = tname(packageName + "." + name);
name += "Legacy" + Strings.capitalize(type.name()); name += "Legacy" + Strings.capitalize(type.name());
} }
@@ -338,7 +342,8 @@ public class EntityProcess extends BaseProcessor{
boolean isVisible = !f.is(Modifier.STATIC) && !f.is(Modifier.PRIVATE) && !f.has(ReadOnly.class); boolean isVisible = !f.is(Modifier.STATIC) && !f.is(Modifier.PRIVATE) && !f.has(ReadOnly.class);
//add the field only if it isn't visible or it wasn't implemented by the base class //add the field only if it isn't visible or it wasn't implemented by the base class
if(!isShadowed || !isVisible){ //legacy classes have no extra fields
if((!isShadowed || !isVisible) && !legacy){
builder.addField(spec); builder.addField(spec);
} }
@@ -348,7 +353,7 @@ public class EntityProcess extends BaseProcessor{
allFields.add(f); allFields.add(f);
//add extra sync fields //add extra sync fields
if(f.has(SyncField.class) && isSync){ if(f.has(SyncField.class) && isSync && !legacy){
if(!f.tname().toString().equals("float")) err("All SyncFields must be of type float", f); if(!f.tname().toString().equals("float")) err("All SyncFields must be of type float", f);
syncedFields.add(f); syncedFields.add(f);
@@ -442,11 +447,14 @@ public class EntityProcess extends BaseProcessor{
} }
} }
boolean specialIO = false;
if(hasIO){ if(hasIO){
//SPECIAL CASE: I/O code //SPECIAL CASE: I/O code
//note that serialization is generated even for non-serializing entities for manual usage //note that serialization is generated even for non-serializing entities for manual usage
if((first.name().equals("read") || first.name().equals("write"))){ if((first.name().equals("read") || first.name().equals("write"))){
io.write(mbuilder, first.name().equals("write")); io.write(mbuilder, first.name().equals("write"));
specialIO = true;
} }
//SPECIAL CASE: sync I/O code //SPECIAL CASE: sync I/O code
@@ -525,8 +533,10 @@ public class EntityProcess extends BaseProcessor{
mbuilder.addStatement("mindustry.gen.Groups.queueFree(($T)this)", Poolable.class); mbuilder.addStatement("mindustry.gen.Groups.queueFree(($T)this)", Poolable.class);
} }
if(!legacy || specialIO){
builder.addMethod(mbuilder.build()); builder.addMethod(mbuilder.build());
} }
}
//add pool reset method and implement Poolable //add pool reset method and implement Poolable
if(ann.pooled()){ if(ann.pooled()){
@@ -560,7 +570,7 @@ public class EntityProcess extends BaseProcessor{
.returns(tname(packageName + "." + name)) .returns(tname(packageName + "." + name))
.addStatement(ann.pooled() ? "return Pools.obtain($L.class, " +name +"::new)" : "return new $L()", name).build()); .addStatement(ann.pooled() ? "return Pools.obtain($L.class, " +name +"::new)" : "return new $L()", name).build());
definitions.add(new EntityDefinition(packageName + "." + name, builder, type, typeIsBase ? null : baseClass, components, groups, allFieldSpecs)); definitions.add(new EntityDefinition(packageName + "." + name, builder, type, typeIsBase ? null : baseClass, components, groups, allFieldSpecs, legacy));
} }
//generate groups //generate groups
@@ -665,11 +675,28 @@ public class EntityProcess extends BaseProcessor{
//build mapping class for sync IDs //build mapping class for sync IDs
TypeSpec.Builder idBuilder = TypeSpec.classBuilder("EntityMapping").addModifiers(Modifier.PUBLIC) TypeSpec.Builder idBuilder = TypeSpec.classBuilder("EntityMapping").addModifiers(Modifier.PUBLIC)
.addField(FieldSpec.builder(TypeName.get(Prov[].class), "idMap", Modifier.PUBLIC, Modifier.STATIC).initializer("new Prov[256]").build()) .addField(FieldSpec.builder(TypeName.get(Prov[].class), "idMap", Modifier.PUBLIC, Modifier.STATIC).initializer("new Prov[256]").build())
.addField(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(ObjectMap.class), .addField(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(ObjectMap.class),
tname(String.class), tname(Prov.class)), tname(String.class), tname(Prov.class)),
"nameMap", Modifier.PUBLIC, Modifier.STATIC).initializer("new ObjectMap<>()").build()) "nameMap", Modifier.PUBLIC, Modifier.STATIC).initializer("new ObjectMap<>()").build())
.addField(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(IntMap.class), tname(String.class)),
"customIdMap", Modifier.PUBLIC, Modifier.STATIC).initializer("new IntMap<>()").build())
.addMethod(MethodSpec.methodBuilder("register").addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(TypeName.get(int.class))
.addParameter(String.class, "name").addParameter(Prov.class, "constructor")
.addStatement("int next = arc.util.Structs.indexOf(idMap, v -> v == null)")
.addStatement("idMap[next] = constructor")
.addStatement("nameMap.put(name, constructor)")
.addStatement("customIdMap.put(next, name)")
.addStatement("return next")
.addJavadoc("Use this method for obtaining a classId for custom modded unit types. Only call this once for each type. Modded types should return this id in their overridden classId method.")
.build())
.addMethod(MethodSpec.methodBuilder("map").addModifiers(Modifier.PUBLIC, Modifier.STATIC) .addMethod(MethodSpec.methodBuilder("map").addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(TypeName.get(Prov.class)).addParameter(int.class, "id").addStatement("return idMap[id]").build()) .returns(TypeName.get(Prov.class)).addParameter(int.class, "id").addStatement("return idMap[id]").build())
.addMethod(MethodSpec.methodBuilder("map").addModifiers(Modifier.PUBLIC, Modifier.STATIC) .addMethod(MethodSpec.methodBuilder("map").addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(TypeName.get(Prov.class)).addParameter(String.class, "name").addStatement("return nameMap.get(name)").build()); .returns(TypeName.get(Prov.class)).addParameter(String.class, "name").addStatement("return nameMap.get(name)").build());
@@ -698,11 +725,6 @@ public class EntityProcess extends BaseProcessor{
}else{ }else{
//round 3: generate actual classes and implement interfaces //round 3: generate actual classes and implement interfaces
//write base classes
for(TypeSpec.Builder b : baseClasses){
write(b, imports.asArray());
}
//implement each definition //implement each definition
for(EntityDefinition def : definitions){ for(EntityDefinition def : definitions){
@@ -725,6 +747,14 @@ public class EntityProcess extends BaseProcessor{
def.builder.addSuperinterface(inter.tname()); def.builder.addSuperinterface(inter.tname());
if(def.legacy) continue;
@Nullable TypeSpec.Builder superclass = null;
if(def.extend != null){
superclass = baseClasses.find(b -> (packageName + "." + Reflect.get(b, "name")).equals(def.extend.toString()));
}
//generate getter/setter for each method //generate getter/setter for each method
for(Smethod method : inter.methods()){ for(Smethod method : inter.methods()){
String var = method.name(); String var = method.name();
@@ -732,14 +762,36 @@ public class EntityProcess extends BaseProcessor{
//make sure it's a real variable AND that the component doesn't already implement it somewhere with custom logic //make sure it's a real variable AND that the component doesn't already implement it somewhere with custom logic
if(field == null || methodNames.contains(method.simpleString())) continue; if(field == null || methodNames.contains(method.simpleString())) continue;
MethodSpec result = null;
//getter //getter
if(!method.isVoid()){ if(!method.isVoid()){
def.builder.addMethod(MethodSpec.overriding(method.e).addStatement("return " + var).build()); result = MethodSpec.overriding(method.e).addStatement("return " + var).build();
} }
//setter //setter
if(method.isVoid() && !Seq.with(field.annotations).contains(f -> f.type.toString().equals("@mindustry.annotations.Annotations.ReadOnly"))){ if(method.isVoid() && !Seq.with(field.annotations).contains(f -> f.type.toString().equals("@mindustry.annotations.Annotations.ReadOnly"))){
def.builder.addMethod(MethodSpec.overriding(method.e).addStatement("this." + var + " = " + var).build()); result = MethodSpec.overriding(method.e).addStatement("this." + var + " = " + var).build();
}
//add getter/setter to parent class, if possible. when this happens, skip adding getters setters *here* because they are defined in the superclass.
if(result != null && superclass != null){
FieldSpec superField = Seq.with(superclass.fieldSpecs).find(f -> f.name.equals(var));
//found the right field, try to check for the method already existing now
if(superField != null){
MethodSpec fr = result;
MethodSpec targetMethod = Seq.with(superclass.methodSpecs).find(m -> m.name.equals(var) && m.returnType.equals(fr.returnType));
//if the method isn't added yet, add it. in any case, skip.
if(targetMethod == null){
superclass.addMethod(result);
}
continue;
}
}
if(result != null){
def.builder.addMethod(result);
} }
} }
} }
@@ -747,8 +799,16 @@ public class EntityProcess extends BaseProcessor{
write(def.builder, imports.asArray()); write(def.builder, imports.asArray());
} }
//write base classes last
for(TypeSpec.Builder b : baseClasses){
write(b, imports.asArray());
}
//TODO nulls were an awful idea
//store nulls //store nulls
TypeSpec.Builder nullsBuilder = TypeSpec.classBuilder("Nulls").addModifiers(Modifier.PUBLIC).addModifiers(Modifier.FINAL); TypeSpec.Builder nullsBuilder = TypeSpec.classBuilder("Nulls").addModifiers(Modifier.PUBLIC).addModifiers(Modifier.FINAL);
//TODO should be dynamic
ObjectSet<String> nullList = ObjectSet.with("unit");
//create mock types of all components //create mock types of all components
for(Stype interf : allInterfaces){ for(Stype interf : allInterfaces){
@@ -767,6 +827,12 @@ public class EntityProcess extends BaseProcessor{
//create null builder //create null builder
String baseName = interf.name().substring(0, interf.name().length() - 1); String baseName = interf.name().substring(0, interf.name().length() - 1);
//prevent Nulls bloat
if(!nullList.contains(Strings.camelize(baseName))){
continue;
}
String className = "Null" + baseName; String className = "Null" + baseName;
TypeSpec.Builder nullBuilder = TypeSpec.classBuilder(className) TypeSpec.Builder nullBuilder = TypeSpec.classBuilder(className)
.addModifiers(Modifier.FINAL); .addModifiers(Modifier.FINAL);
@@ -900,7 +966,7 @@ public class EntityProcess extends BaseProcessor{
} }
String createName(Selement<?> elem){ String createName(Selement<?> elem){
Seq<Stype> comps = types(elem.annotation(EntityDef.class), EntityDef::value).map(this::interfaceToComp);; Seq<Stype> comps = types(elem.annotation(EntityDef.class), EntityDef::value).map(this::interfaceToComp);
comps.sortComparing(Selement::name); comps.sortComparing(Selement::name);
return comps.toString("", s -> s.name().replace("Comp", "")); return comps.toString("", s -> s.name().replace("Comp", ""));
} }
@@ -944,9 +1010,10 @@ public class EntityProcess extends BaseProcessor{
final Selement naming; final Selement naming;
final String name; final String name;
final @Nullable TypeName extend; final @Nullable TypeName extend;
final boolean legacy;
int classID; int classID;
public EntityDefinition(String name, Builder builder, Selement naming, TypeName extend, Seq<Stype> components, Seq<GroupDefinition> groups, Seq<FieldSpec> fieldSpec){ public EntityDefinition(String name, Builder builder, Selement naming, TypeName extend, Seq<Stype> components, Seq<GroupDefinition> groups, Seq<FieldSpec> fieldSpec, boolean legacy){
this.builder = builder; this.builder = builder;
this.name = name; this.name = name;
this.naming = naming; this.naming = naming;
@@ -954,6 +1021,7 @@ public class EntityProcess extends BaseProcessor{
this.components = components; this.components = components;
this.extend = extend; this.extend = extend;
this.fieldSpecs = fieldSpec; this.fieldSpecs = fieldSpec;
this.legacy = legacy;
} }
@Override @Override

View File

@@ -43,7 +43,7 @@ public class AssetsProcess extends BaseProcessor{
texIcons.each((key, val) -> { texIcons.each((key, val) -> {
String[] split = val.split("\\|"); String[] split = val.split("\\|");
String name = Strings.kebabToCamel(split[1]).replace("Medium", "").replace("Icon", ""); String name = Strings.kebabToCamel(split[1]).replace("Medium", "").replace("Icon", "").replace("Ui", "");
if(SourceVersion.isKeyword(name) || name.equals("char")) name += "i"; if(SourceVersion.isKeyword(name) || name.equals("char")) name += "i";
ichtype.addField(FieldSpec.builder(char.class, name, Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL).addJavadoc(String.format("\\u%04x", Integer.parseInt(key))).initializer("'" + ((char)Integer.parseInt(key)) + "'").build()); ichtype.addField(FieldSpec.builder(char.class, name, Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL).addJavadoc(String.format("\\u%04x", Integer.parseInt(key))).initializer("'" + ((char)Integer.parseInt(key)) + "'").build());

View File

@@ -1,154 +0,0 @@
package mindustry.annotations.impl;
import com.sun.source.tree.*;
import com.sun.source.util.*;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type.*;
import com.sun.tools.javac.tree.*;
import com.sun.tools.javac.tree.JCTree.*;
import mindustry.annotations.Annotations.*;
import javax.annotation.processing.*;
import javax.lang.model.*;
import javax.lang.model.element.*;
import javax.tools.Diagnostic.*;
import java.lang.annotation.*;
import java.util.*;
@SupportedAnnotationTypes({"java.lang.Override"})
public class CallSuperProcess extends AbstractProcessor{
private Trees trees;
@Override
public void init(ProcessingEnvironment pe){
super.init(pe);
trees = Trees.instance(pe);
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv){
for(Element e : roundEnv.getElementsAnnotatedWith(Override.class)){
if(e.getAnnotation(OverrideCallSuper.class) != null) return false;
CodeAnalyzerTreeScanner codeScanner = new CodeAnalyzerTreeScanner();
codeScanner.methodName = e.getSimpleName().toString();
TreePath tp = trees.getPath(e.getEnclosingElement());
codeScanner.scan(tp, trees);
if(codeScanner.callSuperUsed){
List list = codeScanner.method.getBody().getStatements();
if(!doesCallSuper(list, codeScanner.methodName)){
processingEnv.getMessager().printMessage(Kind.ERROR, "Overriding method '" + codeScanner.methodName + "' must explicitly call super method from its parent class.", e);
}
}
}
return false;
}
private boolean doesCallSuper(List list, String methodName){
for(Object object : list){
if(object instanceof JCTree.JCExpressionStatement){
JCTree.JCExpressionStatement expr = (JCExpressionStatement)object;
String exprString = expr.toString();
if(exprString.startsWith("super." + methodName) && exprString.endsWith(");")) return true;
}
}
return false;
}
@Override
public SourceVersion getSupportedSourceVersion(){
return SourceVersion.RELEASE_8;
}
static class CodeAnalyzerTreeScanner extends TreePathScanner<Object, Trees>{
String methodName;
MethodTree method;
boolean callSuperUsed;
@Override
public Object visitClass(ClassTree classTree, Trees trees){
Tree extendTree = classTree.getExtendsClause();
if(extendTree instanceof JCTypeApply){ //generic classes case
JCTypeApply generic = (JCTypeApply)extendTree;
extendTree = generic.clazz;
}
if(extendTree instanceof JCIdent){
JCIdent tree = (JCIdent)extendTree;
if(tree == null || tree.sym == null) return super.visitClass(classTree, trees);
com.sun.tools.javac.code.Scope members = tree.sym.members();
if(checkScope(members))
return super.visitClass(classTree, trees);
if(checkSuperTypes((ClassType)tree.type))
return super.visitClass(classTree, trees);
}
callSuperUsed = false;
return super.visitClass(classTree, trees);
}
public boolean checkSuperTypes(ClassType type){
if(type.supertype_field != null && type.supertype_field.tsym != null){
if(checkScope(type.supertype_field.tsym.members()))
return true;
else
return checkSuperTypes((ClassType)type.supertype_field);
}
return false;
}
@SuppressWarnings("unchecked")
public boolean checkScope(Scope members){
Iterable<Symbol> it;
try{
it = (Iterable<Symbol>)members.getClass().getMethod("getElements").invoke(members);
}catch(Throwable t){
try{
it = (Iterable<Symbol>)members.getClass().getMethod("getSymbols").invoke(members);
}catch(Exception e){
throw new RuntimeException(e);
}
}
for(Symbol s : it){
if(s instanceof MethodSymbol){
MethodSymbol ms = (MethodSymbol)s;
if(ms.getSimpleName().toString().equals(methodName)){
Annotation annotation = ms.getAnnotation(CallSuper.class);
if(annotation != null){
callSuperUsed = true;
return true;
}
}
}
}
return false;
}
@Override
public Object visitMethod(MethodTree methodTree, Trees trees){
if(methodTree.getName().toString().equals(methodName))
method = methodTree;
return super.visitMethod(methodTree, trees);
}
}
}

View File

@@ -18,6 +18,7 @@ public class LoadRegionProcessor extends BaseProcessor{
@Override @Override
public void process(RoundEnvironment env) throws Exception{ public void process(RoundEnvironment env) throws Exception{
TypeSpec.Builder regionClass = TypeSpec.classBuilder("ContentRegions") TypeSpec.Builder regionClass = TypeSpec.classBuilder("ContentRegions")
.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "\"deprecation\"").build())
.addModifiers(Modifier.PUBLIC); .addModifiers(Modifier.PUBLIC);
MethodSpec.Builder method = MethodSpec.methodBuilder("loadRegions") MethodSpec.Builder method = MethodSpec.methodBuilder("loadRegions")
.addParameter(tname("mindustry.ctype.MappableContent"), "content") .addParameter(tname("mindustry.ctype.MappableContent"), "content")
@@ -34,7 +35,7 @@ public class LoadRegionProcessor extends BaseProcessor{
} }
for(Entry<Stype, Seq<Svar>> entry : fieldMap){ for(Entry<Stype, Seq<Svar>> entry : fieldMap){
method.beginControlFlow("if(content instanceof $T)", entry.key.tname()); method.beginControlFlow("if(content instanceof $L)", entry.key.fullName());
for(Svar field : entry.value){ for(Svar field : entry.value){
Load an = field.annotation(Load.class); Load an = field.annotation(Load.class);
@@ -45,7 +46,7 @@ public class LoadRegionProcessor extends BaseProcessor{
//not an array //not an array
if(dims == 0){ if(dims == 0){
method.addStatement("(($T)content).$L = $T.atlas.find($L$L)", entry.key.tname(), field.name(), Core.class, parse(an.value()), fallbackString); method.addStatement("(($L)content).$L = $T.atlas.find($L$L)", entry.key.fullName(), field.name(), Core.class, parse(an.value()), fallbackString);
}else{ }else{
//is an array, create length string //is an array, create length string
int[] lengths = an.lengths(); int[] lengths = an.lengths();

View File

@@ -0,0 +1,380 @@
package mindustry.annotations.remote;
import arc.struct.*;
import arc.util.io.*;
import com.squareup.javapoet.*;
import mindustry.annotations.Annotations.*;
import mindustry.annotations.*;
import mindustry.annotations.util.*;
import mindustry.annotations.util.TypeIOResolver.*;
import javax.lang.model.element.*;
import java.io.*;
import static mindustry.annotations.BaseProcessor.*;
/** Generates code for writing remote invoke packets on the client and server. */
public class CallGenerator{
/** Generates all classes in this list. */
public static void generate(ClassSerializer serializer, Seq<MethodEntry> methods) throws IOException{
//create builder
TypeSpec.Builder callBuilder = TypeSpec.classBuilder(RemoteProcess.callLocation).addModifiers(Modifier.PUBLIC);
MethodSpec.Builder register = MethodSpec.methodBuilder("registerPackets")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC);
//go through each method entry in this class
for(MethodEntry ent : methods){
//builder for the packet type
TypeSpec.Builder packet = TypeSpec.classBuilder(ent.packetClassName)
.addModifiers(Modifier.PUBLIC);
//temporary data to deserialize later
packet.addField(FieldSpec.builder(byte[].class, "DATA", Modifier.PRIVATE).initializer("NODATA").build());
packet.superclass(tname("mindustry.net.Packet"));
//return the correct priority
if(ent.priority != PacketPriority.normal){
packet.addMethod(MethodSpec.methodBuilder("getPriority")
.addModifiers(Modifier.PUBLIC)
.addAnnotation(Override.class).returns(int.class).addStatement("return $L", ent.priority.ordinal())
.build());
}
//implement read & write methods
makeWriter(packet, ent, serializer);
makeReader(packet, ent, serializer);
//generate handlers
if(ent.where.isClient){
packet.addMethod(writeHandleMethod(ent, false));
}
if(ent.where.isServer){
packet.addMethod(writeHandleMethod(ent, true));
}
//register packet
register.addStatement("mindustry.net.Net.registerPacket($L.$L::new)", packageName, ent.packetClassName);
//add fields to the type
for(Svar param : ent.element.params()){
packet.addField(param.tname(), param.name(), Modifier.PUBLIC);
}
//write the 'send event to all players' variant: always happens for clients, but only happens if 'all' is enabled on the server method
if(ent.where.isClient || ent.target.isAll){
writeCallMethod(callBuilder, ent, true, false);
}
//write the 'send event to one player' variant, which is only applicable on the server
if(ent.where.isServer && ent.target.isOne){
writeCallMethod(callBuilder, ent, false, false);
}
//write the forwarded method version
if(ent.where.isServer && ent.forward){
writeCallMethod(callBuilder, ent, true, true);
}
//write the completed packet class
JavaFile.builder(packageName, packet.build()).build().writeTo(BaseProcessor.filer);
}
callBuilder.addMethod(register.build());
//build and write resulting class
TypeSpec spec = callBuilder.build();
JavaFile.builder(packageName, spec).build().writeTo(BaseProcessor.filer);
}
private static void makeWriter(TypeSpec.Builder typespec, MethodEntry ent, ClassSerializer serializer){
MethodSpec.Builder builder = MethodSpec.methodBuilder("write")
.addParameter(Writes.class, "WRITE")
.addModifiers(Modifier.PUBLIC).addAnnotation(Override.class);
Seq<Svar> params = ent.element.params();
for(int i = 0; i < params.size; i++){
//first argument is skipped as it is always the player caller
if(!ent.where.isServer && i == 0){
continue;
}
Svar var = params.get(i);
//name of parameter
String varName = var.name();
//name of parameter type
String typeName = var.mirror().toString();
//special case: method can be called from anywhere to anywhere
//thus, only write the player when the SERVER is writing data, since the client is the only one who reads the player anyway
boolean writePlayerSkipCheck = ent.where == Loc.both && i == 0;
if(writePlayerSkipCheck){ //write begin check
builder.beginControlFlow("if(mindustry.Vars.net.server())");
}
if(BaseProcessor.isPrimitive(typeName)){ //check if it's a primitive, and if so write it
builder.addStatement("WRITE.$L($L)", typeName.equals("boolean") ? "bool" : typeName.charAt(0) + "", varName);
}else{
//else, try and find a serializer
String ser = serializer.writers.get(typeName.replace("mindustry.gen.", ""), SerializerResolver.locate(ent.element.e, var.mirror(), true));
if(ser == null){ //make sure a serializer exists!
BaseProcessor.err("No method to write class type: '" + typeName + "'", var);
}
//add statement for writing it
builder.addStatement(ser + "(WRITE, " + varName + ")");
}
if(writePlayerSkipCheck){ //write end check
builder.endControlFlow();
}
}
typespec.addMethod(builder.build());
}
private static void makeReader(TypeSpec.Builder typespec, MethodEntry ent, ClassSerializer serializer){
MethodSpec.Builder readbuilder = MethodSpec.methodBuilder("read")
.addParameter(Reads.class, "READ")
.addParameter(int.class, "LENGTH")
.addModifiers(Modifier.PUBLIC).addAnnotation(Override.class);
//read only into temporary data buffer
readbuilder.addStatement("DATA = READ.b(LENGTH)");
typespec.addMethod(readbuilder.build());
MethodSpec.Builder builder = MethodSpec.methodBuilder("handled")
.addModifiers(Modifier.PUBLIC)
.addAnnotation(Override.class);
//make sure data is present, begin reading it if so
builder.addStatement("BAIS.setBytes(DATA)");
Seq<Svar> params = ent.element.params();
//go through each parameter
for(int i = 0; i < params.size; i++){
Svar var = params.get(i);
//first argument is skipped as it is always the player caller
if(!ent.where.isServer && i == 0){
continue;
}
//special case: method can be called from anywhere to anywhere
//thus, only read the player when the CLIENT is receiving data, since the client is the only one who cares about the player anyway
boolean writePlayerSkipCheck = ent.where == Loc.both && i == 0;
if(writePlayerSkipCheck){ //write begin check
builder.beginControlFlow("if(mindustry.Vars.net.client())");
}
//full type name of parameter
String typeName = var.mirror().toString();
//name of parameter
String varName = var.name();
//capitalized version of type name for reading primitives
String pname = typeName.equals("boolean") ? "bool" : typeName.charAt(0) + "";
//write primitives automatically
if(BaseProcessor.isPrimitive(typeName)){
builder.addStatement("$L = READ.$L()", varName, pname);
}else{
//else, try and find a serializer
String ser = serializer.readers.get(typeName.replace("mindustry.gen.", ""), SerializerResolver.locate(ent.element.e, var.mirror(), false));
if(ser == null){ //make sure a serializer exists!
BaseProcessor.err("No read method to read class type '" + typeName + "' in method " + ent.targetMethod + "; " + serializer.readers, var);
}
//add statement for reading it
builder.addStatement("$L = $L(READ)", varName, ser);
}
if(writePlayerSkipCheck){ //write end check
builder.endControlFlow();
}
}
typespec.addMethod(builder.build());
}
/** Creates a specific variant for a method entry. */
private static void writeCallMethod(TypeSpec.Builder classBuilder, MethodEntry ent, boolean toAll, boolean forwarded){
Smethod elem = ent.element;
Seq<Svar> params = elem.params();
//create builder
MethodSpec.Builder method = MethodSpec.methodBuilder(elem.name() + (forwarded ? "__forward" : "")) //add except suffix when forwarding
.addModifiers(Modifier.STATIC)
.returns(void.class);
//forwarded methods aren't intended for use, and are not public
if(!forwarded){
method.addModifiers(Modifier.PUBLIC);
}
//validate client methods to make sure
if(ent.where.isClient){
if(params.isEmpty()){
BaseProcessor.err("Client invoke methods must have a first parameter of type Player", elem);
return;
}
if(!params.get(0).mirror().toString().contains("Player")){
BaseProcessor.err("Client invoke methods should have a first parameter of type Player", elem);
return;
}
}
//if toAll is false, it's a 'send to one player' variant, so add the player as a parameter
if(!toAll){
method.addParameter(ClassName.bestGuess("mindustry.net.NetConnection"), "playerConnection");
}
//add sender to ignore
if(forwarded){
method.addParameter(ClassName.bestGuess("mindustry.net.NetConnection"), "exceptConnection");
}
//call local method if applicable, shouldn't happen when forwarding method as that already happens by default
if(!forwarded && ent.local != Loc.none){
//add in local checks
if(ent.local != Loc.both){
method.beginControlFlow("if(" + getCheckString(ent.local) + " || !mindustry.Vars.net.active())");
}
//concatenate parameters
int index = 0;
StringBuilder results = new StringBuilder();
for(Svar var : params){
//special case: calling local-only methods uses the local player
if(index == 0 && ent.where == Loc.client){
results.append("mindustry.Vars.player");
}else{
results.append(var.name());
}
if(index != params.size - 1) results.append(", ");
index++;
}
//add the statement to call it
method.addStatement("$N." + elem.name() + "(" + results + ")",
((TypeElement)elem.up()).getQualifiedName().toString());
if(ent.local != Loc.both){
method.endControlFlow();
}
}
//start control flow to check if it's actually client/server so no netcode is called
method.beginControlFlow("if(" + getCheckString(ent.where) + ")");
//add statement to create packet from pool
method.addStatement("$1T packet = new $1T()", tname("mindustry.gen." + ent.packetClassName));
method.addTypeVariables(Seq.with(elem.e.getTypeParameters()).map(BaseProcessor::getTVN));
for(int i = 0; i < params.size; i++){
//first argument is skipped as it is always the player caller
if((!ent.where.isServer) && i == 0){
continue;
}
Svar var = params.get(i);
method.addParameter(var.tname(), var.name());
//name of parameter
String varName = var.name();
//special case: method can be called from anywhere to anywhere
//thus, only write the player when the SERVER is writing data, since the client is the only one who reads it
boolean writePlayerSkipCheck = ent.where == Loc.both && i == 0;
if(writePlayerSkipCheck){ //write begin check
method.beginControlFlow("if(mindustry.Vars.net.server())");
}
method.addStatement("packet.$L = $L", varName, varName);
if(writePlayerSkipCheck){ //write end check
method.endControlFlow();
}
}
String sendString;
if(forwarded){ //forward packet
if(!ent.local.isClient){ //if the client doesn't get it called locally, forward it back after validation
sendString = "mindustry.Vars.net.send(";
}else{
sendString = "mindustry.Vars.net.sendExcept(exceptConnection, ";
}
}else if(toAll){ //send to all players / to server
sendString = "mindustry.Vars.net.send(";
}else{ //send to specific client from server
sendString = "playerConnection.send(";
}
//send the actual packet
method.addStatement(sendString + "packet, " + (!ent.unreliable) + ")");
//end check for server/client
method.endControlFlow();
//add method to class, finally
classBuilder.addMethod(method.build());
}
private static String getCheckString(Loc loc){
return
loc.isClient && loc.isServer ? "mindustry.Vars.net.server() || mindustry.Vars.net.client()" :
loc.isClient ? "mindustry.Vars.net.client()" :
loc.isServer ? "mindustry.Vars.net.server()" : "false";
}
/** Generates handleServer / handleClient methods. */
public static MethodSpec writeHandleMethod(MethodEntry ent, boolean isClient){
//create main method builder
MethodSpec.Builder builder = MethodSpec.methodBuilder(isClient ? "handleClient" : "handleServer")
.addModifiers(Modifier.PUBLIC)
.addAnnotation(Override.class)
.returns(void.class);
Smethod elem = ent.element;
Seq<Svar> params = elem.params();
if(!isClient){
//add player parameter
builder.addParameter(ClassName.get("mindustry.net", "NetConnection"), "con");
//skip if player is invalid
builder.beginControlFlow("if(con.player == null || con.kicked)");
builder.addStatement("return");
builder.endControlFlow();
//make sure to use the actual player who sent the packet
builder.addStatement("mindustry.gen.Player player = con.player");
}
//execute the relevant method before the forward
//if it throws a ValidateException, the method won't be forwarded
builder.addStatement("$N." + elem.name() + "(" + params.toString(", ", s -> s.name()) + ")", ((TypeElement)elem.up()).getQualifiedName().toString());
//call forwarded method, don't forward on the client reader
if(ent.forward && ent.where.isServer && !isClient){
//call forwarded method
builder.addStatement("$L.$L.$L__forward(con, $L)", packageName, ent.className, elem.name(), params.toString(", ", s -> s.name()));
}
return builder.build();
}
}

View File

@@ -1,15 +0,0 @@
package mindustry.annotations.remote;
import java.util.ArrayList;
/** Represents a class witha list method entries to include in it. */
public class ClassEntry{
/** All methods in this generated class. */
public final ArrayList<MethodEntry> methods = new ArrayList<>();
/** Simple class name. */
public final String name;
public ClassEntry(String name){
this.name = name;
}
}

View File

@@ -1,8 +1,7 @@
package mindustry.annotations.remote; package mindustry.annotations.remote;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.annotations.util.*;
import javax.lang.model.element.ExecutableElement;
/** Class that repesents a remote method to be constructed and put into a class. */ /** Class that repesents a remote method to be constructed and put into a class. */
public class MethodEntry{ public class MethodEntry{
@@ -10,6 +9,8 @@ public class MethodEntry{
public final String className; public final String className;
/** Fully qualified target method to call. */ /** Fully qualified target method to call. */
public final String targetMethod; public final String targetMethod;
/** Simple name of the generated packet class. */
public final String packetClassName;
/** Whether this method can be called on a client/server. */ /** Whether this method can be called on a client/server. */
public final Loc where; public final Loc where;
/** /**
@@ -26,12 +27,13 @@ public class MethodEntry{
/** Unique method ID. */ /** Unique method ID. */
public final int id; public final int id;
/** The element method associated with this entry. */ /** The element method associated with this entry. */
public final ExecutableElement element; public final Smethod element;
/** The assigned packet priority. Only used in clients. */ /** The assigned packet priority. Only used in clients. */
public final PacketPriority priority; public final PacketPriority priority;
public MethodEntry(String className, String targetMethod, Loc where, Variant target, public MethodEntry(String className, String targetMethod, String packetClassName, Loc where, Variant target,
Loc local, boolean unreliable, boolean forward, int id, ExecutableElement element, PacketPriority priority){ Loc local, boolean unreliable, boolean forward, int id, Smethod element, PacketPriority priority){
this.packetClassName = packetClassName;
this.className = className; this.className = className;
this.forward = forward; this.forward = forward;
this.targetMethod = targetMethod; this.targetMethod = targetMethod;

View File

@@ -1,7 +1,7 @@
package mindustry.annotations.remote; package mindustry.annotations.remote;
import arc.struct.*; import arc.struct.*;
import com.squareup.javapoet.*; import arc.util.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.annotations.*; import mindustry.annotations.*;
import mindustry.annotations.util.*; import mindustry.annotations.util.*;
@@ -9,7 +9,6 @@ import mindustry.annotations.util.TypeIOResolver.*;
import javax.annotation.processing.*; import javax.annotation.processing.*;
import javax.lang.model.element.*; import javax.lang.model.element.*;
import java.util.*;
/** The annotation processor for generating remote method call code. */ /** The annotation processor for generating remote method call code. */
@@ -18,52 +17,24 @@ import java.util.*;
"mindustry.annotations.Annotations.TypeIOHandler" "mindustry.annotations.Annotations.TypeIOHandler"
}) })
public class RemoteProcess extends BaseProcessor{ public class RemoteProcess extends BaseProcessor{
/** Maximum size of each event packet. */
public static final int maxPacketSize = 8192;
/** Warning on top of each autogenerated file. */
public static final String autogenWarning = "Autogenerated file. Do not modify!\n";
/** Name of class that handles reading and invoking packets on the server. */
private static final String readServerName = "RemoteReadServer";
/** Name of class that handles reading and invoking packets on the client. */
private static final String readClientName = "RemoteReadClient";
/** Simple class name of generated class name. */ /** Simple class name of generated class name. */
private static final String callLocation = "Call"; public static final String callLocation = "Call";
//class serializers
private ClassSerializer serializer;
//all elements with the Remote annotation
private Seq<Smethod> elements;
//map of all classes to generate by name
private HashMap<String, ClassEntry> classMap;
//list of all method entries
private Seq<MethodEntry> methods;
//list of all method entries
private Seq<ClassEntry> classes;
{
rounds = 2;
}
@Override @Override
public void process(RoundEnvironment roundEnv) throws Exception{ public void process(RoundEnvironment roundEnv) throws Exception{
//round 1: find all annotations, generate *writers*
if(round == 1){
//get serializers //get serializers
serializer = TypeIOResolver.resolve(this); //class serializers
ClassSerializer serializer = TypeIOResolver.resolve(this);
//last method ID used //last method ID used
int lastMethodID = 0; int lastMethodID = 0;
//find all elements with the Remote annotation //find all elements with the Remote annotation
elements = methods(Remote.class); //all elements with the Remote annotation
//map of all classes to generate by name Seq<Smethod> elements = methods(Remote.class);
classMap = new HashMap<>();
//list of all method entries //list of all method entries
methods = new Seq<>(); Seq<MethodEntry> methods = new Seq<>();
//list of all method entries
classes = new Seq<>();
Seq<Smethod> orderedElements = elements.copy(); Seq<Smethod> orderedElements = elements.copy();
orderedElements.sort((a, b) -> -a.toString().compareTo(b.toString())); orderedElements.sortComparing(Selement::toString);
//create methods //create methods
for(Smethod element : orderedElements){ for(Smethod element : orderedElements){
@@ -79,45 +50,25 @@ public class RemoteProcess extends BaseProcessor{
err("A @Remote method's targets() cannot be equal to 'none'", element); err("A @Remote method's targets() cannot be equal to 'none'", element);
} }
//get and create class entry if needed String packetName = Strings.capitalize(element.name()) + "CallPacket";
if(!classMap.containsKey(callLocation)){ int[] index = {1};
ClassEntry clas = new ClassEntry(callLocation);
classMap.put(callLocation, clas); while(methods.contains(m -> m.packetClassName.equals(packetName + (index[0] == 1 ? "" : index[0])))){
classes.add(clas); index[0] ++;
} }
ClassEntry entry = classMap.get(callLocation);
//create and add entry //create and add entry
MethodEntry method = new MethodEntry(entry.name, BaseProcessor.getMethodName(element.e), annotation.targets(), annotation.variants(), MethodEntry method = new MethodEntry(
annotation.called(), annotation.unreliable(), annotation.forward(), lastMethodID++, element.e, annotation.priority()); callLocation, BaseProcessor.getMethodName(element.e), packetName + (index[0] == 1 ? "" : index[0]),
annotation.targets(), annotation.variants(),
annotation.called(), annotation.unreliable(), annotation.forward(), lastMethodID++,
element, annotation.priority()
);
entry.methods.add(method);
methods.add(method); methods.add(method);
} }
//create read/write generators //generate the methods to invoke, as well as the packet classes
RemoteWriteGenerator writegen = new RemoteWriteGenerator(serializer); CallGenerator.generate(serializer, methods);
//generate the methods to invoke (write)
writegen.generateFor(classes, packageName);
}else if(round == 2){ //round 2: generate all *readers*
RemoteReadGenerator readgen = new RemoteReadGenerator(serializer);
//generate server readers
readgen.generateFor(methods.select(method -> method.where.isClient), readServerName, packageName, true);
//generate client readers
readgen.generateFor(methods.select(method -> method.where.isServer), readClientName, packageName, false);
//create class for storing unique method hash
TypeSpec.Builder hashBuilder = TypeSpec.classBuilder("MethodHash").addModifiers(Modifier.PUBLIC);
hashBuilder.addJavadoc(autogenWarning);
hashBuilder.addField(FieldSpec.builder(int.class, "HASH", Modifier.STATIC, Modifier.PUBLIC, Modifier.FINAL)
.initializer("$1L", Arrays.hashCode(methods.map(m -> m.element).toArray())).build());
//build and write resulting hash class
TypeSpec spec = hashBuilder.build();
JavaFile.builder(packageName, spec).build().writeTo(BaseProcessor.filer);
}
} }
} }

View File

@@ -1,129 +0,0 @@
package mindustry.annotations.remote;
import arc.struct.*;
import arc.util.io.*;
import com.squareup.javapoet.*;
import mindustry.annotations.*;
import mindustry.annotations.util.TypeIOResolver.*;
import javax.lang.model.element.*;
/** Generates code for reading remote invoke packets on the client and server. */
public class RemoteReadGenerator{
private final ClassSerializer serializers;
/** Creates a read generator that uses the supplied serializer setup. */
public RemoteReadGenerator(ClassSerializer serializers){
this.serializers = serializers;
}
/**
* Generates a class for reading remote invoke packets.
* @param entries List of methods to use.
* @param className Simple target class name.
* @param packageName Full target package name.
* @param needsPlayer Whether this read method requires a reference to the player sender.
*/
public void generateFor(Seq<MethodEntry> entries, String className, String packageName, boolean needsPlayer) throws Exception{
TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC);
classBuilder.addJavadoc(RemoteProcess.autogenWarning);
//create main method builder
MethodSpec.Builder readMethod = MethodSpec.methodBuilder("readPacket")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.addParameter(Reads.class, "read") //buffer to read form
.addParameter(int.class, "id") //ID of method type to read
.returns(void.class);
if(needsPlayer){
//add player parameter
readMethod.addParameter(ClassName.get(packageName, "Player"), "player");
}
CodeBlock.Builder readBlock = CodeBlock.builder(); //start building block of code inside read method
boolean started = false; //whether an if() statement has been written yet
for(MethodEntry entry : entries){
//write if check for this entry ID
if(!started){
started = true;
readBlock.beginControlFlow("if(id == " + entry.id + ")");
}else{
readBlock.nextControlFlow("else if(id == " + entry.id + ")");
}
readBlock.beginControlFlow("try");
//concatenated list of variable names for method invocation
StringBuilder varResult = new StringBuilder();
//go through each parameter
for(int i = 0; i < entry.element.getParameters().size(); i++){
VariableElement var = entry.element.getParameters().get(i);
if(!needsPlayer || i != 0){ //if client, skip first parameter since it's always of type player and doesn't need to be read
//full type name of parameter
String typeName = var.asType().toString();
//name of parameter
String varName = var.getSimpleName().toString();
//captialized version of type name for reading primitives
String pname = typeName.equals("boolean") ? "bool" : typeName.charAt(0) + "";
//write primitives automatically
if(BaseProcessor.isPrimitive(typeName)){
readBlock.addStatement("$L $L = read.$L()", typeName, varName, pname);
}else{
//else, try and find a serializer
String ser = serializers.readers.get(typeName.replace("mindustry.gen.", ""), SerializerResolver.locate(entry.element, var.asType(), false));
if(ser == null){ //make sure a serializer exists!
BaseProcessor.err("No read method to read class type '" + typeName + "' in method " + entry.targetMethod + "; " + serializers.readers, var);
return;
}
//add statement for reading it
readBlock.addStatement(typeName + " " + varName + " = " + ser + "(read)");
}
//append variable name to string builder
varResult.append(var.getSimpleName());
if(i != entry.element.getParameters().size() - 1) varResult.append(", ");
}else{
varResult.append("player");
if(i != entry.element.getParameters().size() - 1) varResult.append(", ");
}
}
//execute the relevant method before the forward
//if it throws a ValidateException, the method won't be forwarded
readBlock.addStatement("$N." + entry.element.getSimpleName() + "(" + varResult.toString() + ")", ((TypeElement)entry.element.getEnclosingElement()).getQualifiedName().toString());
//call forwarded method, don't forward on the client reader
if(entry.forward && entry.where.isServer && needsPlayer){
//call forwarded method
readBlock.addStatement(packageName + "." + entry.className + "." + entry.element.getSimpleName() +
"__forward(player.con" + (varResult.length() == 0 ? "" : ", ") + varResult.toString() + ")");
}
readBlock.nextControlFlow("catch (java.lang.Exception e)");
readBlock.addStatement("throw new java.lang.RuntimeException(\"Failed to read remote method '" + entry.element.getSimpleName() + "'!\", e)");
readBlock.endControlFlow();
}
//end control flow if necessary
if(started){
readBlock.nextControlFlow("else");
readBlock.addStatement("throw new $1N(\"Invalid read method ID: \" + id + \"\")", RuntimeException.class.getName()); //handle invalid method IDs
readBlock.endControlFlow();
}
//add block and method to class
readMethod.addCode(readBlock.build());
classBuilder.addMethod(readMethod.build());
//build and write resulting class
TypeSpec spec = classBuilder.build();
JavaFile.builder(packageName, spec).build().writeTo(BaseProcessor.filer);
}
}

View File

@@ -1,228 +0,0 @@
package mindustry.annotations.remote;
import arc.struct.*;
import arc.util.io.*;
import com.squareup.javapoet.*;
import mindustry.annotations.Annotations.*;
import mindustry.annotations.*;
import mindustry.annotations.util.TypeIOResolver.*;
import javax.lang.model.element.*;
import java.io.*;
/** Generates code for writing remote invoke packets on the client and server. */
public class RemoteWriteGenerator{
private final ClassSerializer serializers;
/** Creates a write generator that uses the supplied serializer setup. */
public RemoteWriteGenerator(ClassSerializer serializers){
this.serializers = serializers;
}
/** Generates all classes in this list. */
public void generateFor(Seq<ClassEntry> entries, String packageName) throws IOException{
for(ClassEntry entry : entries){
//create builder
TypeSpec.Builder classBuilder = TypeSpec.classBuilder(entry.name).addModifiers(Modifier.PUBLIC);
classBuilder.addJavadoc(RemoteProcess.autogenWarning);
//add temporary write buffer
classBuilder.addField(FieldSpec.builder(ReusableByteOutStream.class, "OUT", Modifier.STATIC, Modifier.PRIVATE, Modifier.FINAL)
.initializer("new ReusableByteOutStream($L)", RemoteProcess.maxPacketSize).build());
//add writer for that buffer
classBuilder.addField(FieldSpec.builder(Writes.class, "WRITE", Modifier.STATIC, Modifier.PRIVATE, Modifier.FINAL)
.initializer("new Writes(new $T(OUT))", DataOutputStream.class).build());
//go through each method entry in this class
for(MethodEntry methodEntry : entry.methods){
//write the 'send event to all players' variant: always happens for clients, but only happens if 'all' is enabled on the server method
if(methodEntry.where.isClient || methodEntry.target.isAll){
writeMethodVariant(classBuilder, methodEntry, true, false);
}
//write the 'send event to one player' variant, which is only applicable on the server
if(methodEntry.where.isServer && methodEntry.target.isOne){
writeMethodVariant(classBuilder, methodEntry, false, false);
}
//write the forwarded method version
if(methodEntry.where.isServer && methodEntry.forward){
writeMethodVariant(classBuilder, methodEntry, true, true);
}
}
//build and write resulting class
TypeSpec spec = classBuilder.build();
JavaFile.builder(packageName, spec).build().writeTo(BaseProcessor.filer);
}
}
/** Creates a specific variant for a method entry. */
private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry methodEntry, boolean toAll, boolean forwarded){
ExecutableElement elem = methodEntry.element;
//create builder
MethodSpec.Builder method = MethodSpec.methodBuilder(elem.getSimpleName().toString() + (forwarded ? "__forward" : "")) //add except suffix when forwarding
.addModifiers(Modifier.STATIC)
.returns(void.class);
//forwarded methods aren't intended for use, and are not public
if(!forwarded){
method.addModifiers(Modifier.PUBLIC);
}
//validate client methods to make sure
if(methodEntry.where.isClient){
if(elem.getParameters().isEmpty()){
BaseProcessor.err("Client invoke methods must have a first parameter of type Player", elem);
return;
}
if(!elem.getParameters().get(0).asType().toString().contains("Player")){
BaseProcessor.err("Client invoke methods should have a first parameter of type Player", elem);
return;
}
}
//if toAll is false, it's a 'send to one player' variant, so add the player as a parameter
if(!toAll){
method.addParameter(ClassName.bestGuess("mindustry.net.NetConnection"), "playerConnection");
}
//add sender to ignore
if(forwarded){
method.addParameter(ClassName.bestGuess("mindustry.net.NetConnection"), "exceptConnection");
}
//call local method if applicable, shouldn't happen when forwarding method as that already happens by default
if(!forwarded && methodEntry.local != Loc.none){
//add in local checks
if(methodEntry.local != Loc.both){
method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !mindustry.Vars.net.active())");
}
//concatenate parameters
int index = 0;
StringBuilder results = new StringBuilder();
for(VariableElement var : elem.getParameters()){
//special case: calling local-only methods uses the local player
if(index == 0 && methodEntry.where == Loc.client){
results.append("mindustry.Vars.player");
}else{
results.append(var.getSimpleName());
}
if(index != elem.getParameters().size() - 1) results.append(", ");
index++;
}
//add the statement to call it
method.addStatement("$N." + elem.getSimpleName() + "(" + results.toString() + ")",
((TypeElement)elem.getEnclosingElement()).getQualifiedName().toString());
if(methodEntry.local != Loc.both){
method.endControlFlow();
}
}
//start control flow to check if it's actually client/server so no netcode is called
method.beginControlFlow("if(" + getCheckString(methodEntry.where) + ")");
//add statement to create packet from pool
method.addStatement("$1N packet = $2N.obtain($1N.class, $1N::new)", "mindustry.net.Packets.InvokePacket", "arc.util.pooling.Pools");
//assign priority
method.addStatement("packet.priority = (byte)" + methodEntry.priority.ordinal());
//assign method ID
method.addStatement("packet.type = (byte)" + methodEntry.id);
//reset stream
method.addStatement("OUT.reset()");
method.addTypeVariables(Seq.with(elem.getTypeParameters()).map(BaseProcessor::getTVN));
for(int i = 0; i < elem.getParameters().size(); i++){
//first argument is skipped as it is always the player caller
if((!methodEntry.where.isServer/* || methodEntry.mode == Loc.both*/) && i == 0){
continue;
}
VariableElement var = elem.getParameters().get(i);
try{
//add parameter to method
method.addParameter(TypeName.get(var.asType()), var.getSimpleName().toString());
}catch(Throwable t){
throw new RuntimeException("Error parsing method " + methodEntry.targetMethod);
}
//name of parameter
String varName = var.getSimpleName().toString();
//name of parameter type
String typeName = var.asType().toString();
//captialized version of type name for writing primitives
String capName = typeName.equals("byte") ? "" : Character.toUpperCase(typeName.charAt(0)) + typeName.substring(1);
//special case: method can be called from anywhere to anywhere
//thus, only write the player when the SERVER is writing data, since the client is the only one who reads it
boolean writePlayerSkipCheck = methodEntry.where == Loc.both && i == 0;
if(writePlayerSkipCheck){ //write begin check
method.beginControlFlow("if(mindustry.Vars.net.server())");
}
if(BaseProcessor.isPrimitive(typeName)){ //check if it's a primitive, and if so write it
method.addStatement("WRITE.$L($L)", typeName.equals("boolean") ? "bool" : typeName.charAt(0) + "", varName);
}else{
//else, try and find a serializer
String ser = serializers.writers.get(typeName.replace("mindustry.gen.", ""), SerializerResolver.locate(elem, var.asType(), true));
if(ser == null){ //make sure a serializer exists!
BaseProcessor.err("No @WriteClass method to write class type: '" + typeName + "'", var);
return;
}
//add statement for writing it
method.addStatement(ser + "(WRITE, " + varName + ")");
}
if(writePlayerSkipCheck){ //write end check
method.endControlFlow();
}
}
//assign packet bytes
method.addStatement("packet.bytes = OUT.getBytes()");
//assign packet length
method.addStatement("packet.length = OUT.size()");
String sendString;
if(forwarded){ //forward packet
if(!methodEntry.local.isClient){ //if the client doesn't get it called locally, forward it back after validation
sendString = "mindustry.Vars.net.send(";
}else{
sendString = "mindustry.Vars.net.sendExcept(exceptConnection, ";
}
}else if(toAll){ //send to all players / to server
sendString = "mindustry.Vars.net.send(";
}else{ //send to specific client from server
sendString = "playerConnection.send(";
}
//send the actual packet
method.addStatement(sendString + "packet, " +
(methodEntry.unreliable ? "mindustry.net.Net.SendMode.udp" : "mindustry.net.Net.SendMode.tcp") + ")");
//end check for server/client
method.endControlFlow();
//add method to class, finally
classBuilder.addMethod(method.build());
}
private String getCheckString(Loc loc){
return loc.isClient && loc.isServer ? "mindustry.Vars.net.server() || mindustry.Vars.net.client()" :
loc.isClient ? "mindustry.Vars.net.client()" :
loc.isServer ? "mindustry.Vars.net.server()" : "false";
}
}

View File

@@ -1,7 +1,6 @@
package mindustry.annotations.util; package mindustry.annotations.util;
import com.sun.source.tree.*; import com.sun.source.tree.*;
import com.sun.tools.javac.tree.JCTree.*;
import mindustry.annotations.*; import mindustry.annotations.*;
import javax.lang.model.element.*; import javax.lang.model.element.*;
@@ -16,10 +15,6 @@ public class Svar extends Selement<VariableElement>{
return up().asType().toString() + "#" + super.toString().replace("mindustry.gen.", ""); return up().asType().toString() + "#" + super.toString().replace("mindustry.gen.", "");
} }
public JCVariableDecl jtree(){
return (JCVariableDecl)BaseProcessor.elementu.getTree(e);
}
public Stype enclosingType(){ public Stype enclosingType(){
return new Stype((TypeElement)up()); return new Stype((TypeElement)up());
} }

View File

@@ -22,6 +22,7 @@ mindustry.entities.comp.PosTeamDef=28
mindustry.entities.comp.PuddleComp=13 mindustry.entities.comp.PuddleComp=13
mindustry.type.Weather.WeatherStateComp=14 mindustry.type.Weather.WeatherStateComp=14
mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=15 mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=15
mindustry.world.blocks.campaign.PayloadLaunchPad.LargeLaunchPayloadComp=34
mindustry.world.blocks.defense.ForceProjector.ForceDrawComp=22 mindustry.world.blocks.defense.ForceProjector.ForceDrawComp=22
mono=16 mono=16
nova=17 nova=17

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:collided,type:arc.struct.IntSeq},{name:damage,type:float},{name:data,type:java.lang.Object},{name:fdata,type:float},{name:lifetime,type:float},{name:owner,type:mindustry.gen.Entityc},{name:rotation,type:float},{name:team,type:mindustry.game.Team},{name:time,type:float},{name:type,type:mindustry.entities.bullet.BulletType},{name:x,type:float},{name:y,type:float}]}

View File

@@ -0,0 +1 @@
{fields:[{name:lifetime,type:float},{name:payload,type:mindustry.world.blocks.payloads.Payload},{name:team,type:mindustry.game.Team},{name:time,type:float},{name:x,type:float},{name:y,type:float}]}

View File

@@ -13,29 +13,51 @@ buildscript{
google() google()
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" } maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven{ url 'https://jitpack.io' } maven{ url 'https://jitpack.io' }
//fake repository to download my patched robovm jar from
ivy{
url 'https://github.com/'
patternLayout {
artifact '/[organisation]/[module]/raw/a-single-jar-file/[revision].jar'
}
// This is required in Gradle 6.0+ as metadata file (ivy.xml)
// is mandatory. Docs linked below this code section
metadataSources { artifact() }
}
} }
dependencies{ dependencies{
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.11' //use local, patched robovm gradle plugin until my PR for gradle 7.0 support is merged
classpath "com.github.anuken:packr:-SNAPSHOT" //https://github.com/Anuken/robovm/raw/a-single-jar-file/robovm-gradle-plugin-2.3.14-SNAPSHOT.jar
classpath "Anuken:robovm:robovm-gradle-plugin-2.3.14-SNAPSHOT"
//needed for plugin above
classpath "com.mobidevelop.robovm:robovm-dist-compiler:2.3.13"
classpath "com.github.Anuken.Arc:packer:$arcHash" classpath "com.github.Anuken.Arc:packer:$arcHash"
classpath "com.github.Anuken.Arc:arc-core:$arcHash" classpath "com.github.Anuken.Arc:arc-core:$arcHash"
} }
} }
plugins{
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
id "org.jetbrains.kotlin.kapt" version "1.4.32"
}
allprojects{ allprojects{
apply plugin: 'maven' apply plugin: 'maven-publish'
version = 'release' version = 'release'
group = 'com.github.Anuken' group = 'com.github.Anuken'
ext{ ext{
versionNumber = '6' versionNumber = '7'
if(!project.hasProperty("versionModifier")) versionModifier = 'release' if(!project.hasProperty("versionModifier")) versionModifier = 'pre-alpha'
if(!project.hasProperty("versionType")) versionType = 'official' if(!project.hasProperty("versionType")) versionType = 'official'
appName = 'Mindustry' appName = 'Mindustry'
steamworksVersion = '891ed912791e01fe9ee6237a6497e5212b85c256' steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
rhinoVersion = '378626d8abc552bba57864358358045d2f2dbe9b' rhinoVersion = '55bf0dac1cfa7770672fd26112512c733ca9d5dc'
loadVersionProps = { loadVersionProps = {
return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p } return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
@@ -83,13 +105,11 @@ allprojects{
} }
hasSprites = { hasSprites = {
return new File(rootDir, "core/assets/sprites/sprites.atlas").exists() return new File(rootDir, "core/assets/sprites/sprites.aatls").exists()
} }
getModifierString = { getModifierString = {
if(versionModifier != "release"){ if(versionModifier != "release") return "[${versionModifier.toUpperCase()}]"
return "[${versionModifier.toUpperCase()}]"
}
return "" return ""
} }
@@ -107,8 +127,7 @@ allprojects{
def v = System.getenv("ANDROID_HOME") def v = System.getenv("ANDROID_HOME")
if(v != null) return v if(v != null) return v
//rootDir is null here, amazing. brilliant. //rootDir is null here, amazing. brilliant.
def file = new File("local.properties") def file = new File(rootDir, "local.properties")
if(!file.exists()) file = new File("../local.properties")
def props = new Properties().with{p -> p.load(file.newReader()); return p } def props = new Properties().with{p -> p.load(file.newReader()); return p }
return props.get("sdk.dir") return props.get("sdk.dir")
} }
@@ -195,10 +214,15 @@ allprojects{
tasks.withType(JavaCompile){ tasks.withType(JavaCompile){
targetCompatibility = 8 targetCompatibility = 8
sourceCompatibility = 14 sourceCompatibility = JavaVersion.VERSION_16
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.compilerArgs += ["-Xlint:deprecation"] options.compilerArgs += ["-Xlint:deprecation"]
dependsOn clearCache dependsOn clearCache
options.forkOptions.jvmArgs.addAll([
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED'
])
} }
} }
@@ -206,26 +230,20 @@ configure(project(":annotations")){
tasks.withType(JavaCompile){ tasks.withType(JavaCompile){
targetCompatibility = 8 targetCompatibility = 8
sourceCompatibility = 8 sourceCompatibility = 8
options.fork = true
} }
} }
//compile with java 8 compatibility for everything except the annotation project //compile with java 8 compatibility for everything except the annotation project
configure(subprojects - project(":annotations")){ configure(subprojects - project(":annotations")){
tasks.withType(JavaCompile){ tasks.withType(JavaCompile){
if(JavaVersion.current() != JavaVersion.VERSION_1_8){ options.compilerArgs.addAll(['--release', '8'])
options.compilerArgs.addAll(['--release', '8', '--enable-preview'])
}
doFirst{
options.compilerArgs = options.compilerArgs.findAll{it != '--enable-preview' }
}
} }
tasks.withType(Javadoc){ tasks.withType(Javadoc){
options{ options{
addStringOption('Xdoclint:none', '-quiet') addStringOption('Xdoclint:none', '-quiet')
addBooleanOption('-enable-preview', true) addStringOption('-release', '16')
addStringOption('-release', '14')
} }
} }
} }
@@ -237,9 +255,9 @@ project(":desktop"){
dependencies{ dependencies{
implementation project(":core") implementation project(":core")
implementation arcModule("extensions:discord")
implementation arcModule("natives:natives-desktop") implementation arcModule("natives:natives-desktop")
implementation arcModule("natives:natives-freetype-desktop") implementation arcModule("natives:natives-freetype-desktop")
implementation 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1'
if(debugged()) implementation project(":debug") if(debugged()) implementation project(":debug")
@@ -287,6 +305,15 @@ project(":ios"){
project(":core"){ project(":core"){
apply plugin: "java-library" apply plugin: "java-library"
apply plugin: "kotlin"
apply plugin: "kotlin-kapt"
kapt{
javacOptions{
option("-source", "16")
option("-target", "1.8")
}
}
compileJava.options.fork = true compileJava.options.fork = true
@@ -345,19 +372,20 @@ project(":core"){
dependencies{ dependencies{
compileJava.dependsOn(preGen) compileJava.dependsOn(preGen)
api "org.lz4:lz4-java:1.4.1" api "org.lz4:lz4-java:1.7.1"
api arcModule("arc-core") api arcModule("arc-core")
api arcModule("extensions:flabel")
api arcModule("extensions:freetype") api arcModule("extensions:freetype")
api arcModule("extensions:g3d") api arcModule("extensions:g3d")
api arcModule("extensions:fx") api arcModule("extensions:fx")
api arcModule("extensions:arcnet") api arcModule("extensions:arcnet")
api "com.github.Anuken:rhino:$rhinoVersion" api "com.github.Anuken:rhino:$rhinoVersion"
if(localArc() && debugged()) api arcModule("extensions:recorder") if(localArc() && debugged()) api arcModule("extensions:recorder")
if(localArc()) api arcModule(":extensions:packer")
compileOnly project(":annotations")
annotationProcessor project(":annotations")
annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd' annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd'
compileOnly project(":annotations")
kapt project(":annotations")
} }
afterEvaluate{ afterEvaluate{
@@ -381,6 +409,11 @@ project(":core"){
destinationDir = new File(buildDir, 'javadoc') destinationDir = new File(buildDir, 'javadoc')
} }
} }
//comp** classes are only used for code generation
jar{
exclude("mindustry/entities/comp/**")
}
} }
project(":server"){ project(":server"){
@@ -397,16 +430,18 @@ project(":tests"){
dependencies{ dependencies{
testImplementation project(":core") testImplementation project(":core")
testImplementation "org.junit.jupiter:junit-jupiter-params:5.3.1" testImplementation "org.junit.jupiter:junit-jupiter-params:5.7.1"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.1" testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
testImplementation arcModule("backends:backend-headless") testImplementation arcModule("backends:backend-headless")
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.3.1" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
} }
test{ test{
//fork every test so mods don't interact with each other
forkEvery = 1
useJUnitPlatform() useJUnitPlatform()
workingDir = new File("../core/assets") workingDir = new File("../core/assets")
testLogging { testLogging{
exceptionFormat = 'full' exceptionFormat = 'full'
showStandardStreams = true showStandardStreams = true
} }
@@ -434,6 +469,21 @@ project(":annotations"){
} }
} }
configure([":core", ":desktop", ":server", ":tools"].collect{project(it)}){
java{
withJavadocJar()
withSourcesJar()
}
publishing{
publications{
maven(MavenPublication){
from components.java
}
}
}
}
task deployAll{ task deployAll{
task cleanDeployOutput{ task cleanDeployOutput{
doFirst{ doFirst{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 1001 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Some files were not shown because too many files have changed in this diff Show More