diff options
author | Eryk Ruta <70776766+kingstefan26@users.noreply.github.com> | 2022-11-01 15:51:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-01 23:51:30 +0900 |
commit | 292fbd05e13271ca3ad99ebe00ae4302e04848f3 (patch) | |
tree | 2a7aeb12ab95ff688479a4727f76e3e4152c30b5 /src/main | |
parent | dd7a4209752715db544b2fef804da9762c532cdc (diff) | |
download | Skyblock-Dungeons-Guide-292fbd05e13271ca3ad99ebe00ae4302e04848f3.tar.gz Skyblock-Dungeons-Guide-292fbd05e13271ca3ad99ebe00ae4302e04848f3.tar.bz2 Skyblock-Dungeons-Guide-292fbd05e13271ca3ad99ebe00ae4302e04848f3.zip |
3rd time is the charm (#70)
* Updated some dependencies, used my crusty skytils forgegradle fork + removed the IRRELEVANT hytils fixes. generally made the thing build
* made the logs less annoying
* temp fix so it doesn't throw an exception
* FAT REFACTOR
General refactor on
Authenticator.java
DungeonsGuide.java
Main.java
removed unnecessary imports where not needed
to be removed DGInterface.java (no real reason to exist)
in DungeonsGuide.java made the retry stomp a singe-thread executor, so it doesn't leak when offline
added an "offline mode" so it doesn't just error when server down
TODO: move auth to DungeonsGuide.java and make it retry when network down on launch
* New auth implementation that should replace the old one:
does all the things the old one did
removed progressBar cuz it would make the impl 3x more complicated in the name of a splash screen
added a token changed event (so now it supports re-logging with a different account)
code is (should) be more readable / extensible
TODO: surgically replace Authenticator.java with new impl AND support re-logging
* Made the chat processor logger name less obnoxious
* implemented my implementation of an implementation of auth
can and is very buggy, essentially the loading of the remote classes but the mod works so idk
TODO: MAKE STOMP NOT DO STUFF TILL STOMPCONNECTED IS EMITTED
* fix for stomp client null bc forge events not going tru on pre-init
TODO: make work and test the web loadable classes, then make all the stuff that relies on stomp not throw exceptions when stomp is not connected
* move the create auth method into AuthProvider interface,
so we don't clutter AuthManager with implementation details
* Decouple AuthProviderUtil and DgAuth,
move some stuff around and make it more readable
* moved AuthUtil to make more sense
* de-clutter the tree a little bit
* Inline StompClientStatus.java / refactor
* inline the useless interface
* refactoringgg
* fix ahUtils exeption spam
* small StompClient refactor
* fix GLCursors exeption spam + logger
* make sure we are authenticated when downloading resources
* new .destination("value") instead of .header("destination", "value")
* StompMessageHandler -> StompMessageSubscription
* Introduced StompManager
* fix dungeon map not showing ppl heads
* ehhh
* wip (commit cuz im chekig out)
* fix player profile not never loading in chat
* remove this specific line
* fix player profile not never loading in chat
* cut out hychat like a cancer
* ApiFetchur now caches whole players not single profiles,
added a switch profile button in gui
* ugh git
* Revert "cut out hychat like a cancer"
This reverts commit 2ee11afa
* ugh git x2
* I tried, good luck maintaining this
* forgot to uncomment hychat fix
* make my new party ready work and look ok
* change the look and add some "somewhere" locations
* make stomp connection "null safe"
* i hate git
* introduce callbacks on parameter change for cleaner code
add one example
* impl new system,
half way done
* now shows which profile is now selected
put button on top
a lil refactor
* fix player profile sometimes not loading
* add players knowing who is using dg (try to)
* announcing that we are a dg user will get reworked in the future
* update deps
* make it not spam logs
* sanity check for premium features so it doesn't 403
* add YoMamaOutdated that checks if you are using outdated dg
* hychat?? anyone
* try catch in FeatureRegistry
* added Ether transmission ability
* chat shredder borken, disabled for now
* party deserves its own folder
* dungeon stuff in dungeon folder
* events folders moved
* fix score data collection hanging forever if stomp is not connected
* fix stomp never connecting
* re-add the removed
* fix wonky rendering
* server side implementation is not ready, canning this for a future release
* attempt to fix heads loading on main thread
* discord
* me when sonar lint
* new consumer based stomp subscriptions
* replace old with new subscriptions
* remove the remains of StompSubscription and replace CloseListener with a forge event
* StompSubscription is now a functional interface
* remove unnecessary event message chains,
feature logic should be in the feature
* fix events being set up wrongly
* Revert "fix events being set up wrongly"
This reverts commit e6ea7efa557a5f5c8a3ea33be998717bc024b8cb.
* Revert "remove unnecessary event message chains,"
This reverts commit 96f508bae85b33cdcef6be19226c00fc52a1439b.
* fix stomp client sending payload object instead of the actual payload
* fix null pointer on empty party
* fix players with cosmetics name being white in tab
* added message when not connected to dg
changed YoMamaOutdated to use CloudFlare workers
added client sided message queue
* the mod doesn't init when outdated
* mcmod.info
* dont busy wait in authmenager
* test pepole crusty tests
* chill out the authmanager
* name the thread pool in auth manager
* clear most compiler warnings
* make outdated check allow to play without the mod initialized
* make first startup VERY noticeable, move config creation to main
* major dungeon package refactor
* refactor checkpoint
* refactor checkpoint #1
* final refactor checkpoint #2
* remove the player if from version check, made the version check not nesssery for playing
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* remove trap room fix that didnt fix anything
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* make secret beacons optional
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* make the checkmarks on map align with the rest of everyone
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* removed debug function
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move the menus to make more sense + make destination text on secrets optional
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* improve dungeonMap performance by ~90%
temporarly disabled 9 slot map player location due to bugs
fix DungeonContext not getting player from ScoreBoard
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* add epic countdown on dungeon start (still wip)
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* added a option to cache blockstaes
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* added TabListUtil
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* fixed epic countdown
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* (i want to sleep) made all the dungeon room detection async
TODO: fix ol the bugs i created by doing that
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* stuff still broken but almost playable, unlike last commit
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* upload build jar to discord
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* cache the deps for the love of god
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* who needs linux and 32bit windows anyway
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* only upload to discord on beta branch
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* added "kick" when a member joins party
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move stuff that sends chat to player into a separate class
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* use our chat queue instead of calling `thePlayer.addChatMessage` to proxy ourselves from 1.8 code
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* Added and implemented MortDetector2000.java
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* extract duplicate + make more readable
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* added dummy support in FeatureDebugTrap
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* gradle now puts version in mcmod.info
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* remove side effects from DgAuth.java
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move debug commands into debug CommandDgDebug.java
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* fix key being wrong
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move epic countdown to dungeon huds, clean up
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* Revert "who needs linux and 32bit windows anyway"
This reverts commit 0f3c2d544a70fc799cd3215dad5e997c0c8b6c06.
* make FeatureRegistry not static initialise to get rid of "ClassNotDefined" errors
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* null check on Exception since it threw NullPointers
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* finish up progress bar in DungeonsGuide.java
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* warn about null features
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move stuff around in SkyblockStatus, move the stuff that updates status into SkyblockStatus from DungeonListener
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* rename DungeonGodObject.java to DungeonFacade.java
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* add cleanChat clause in FeatureEpicCountdown
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* implement getPreRequisites and isComplete in ActionBreakWithSuperBoom
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* clean up FeatureParameter
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* eliminate possible state inconsistency in DungeonListener
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move percentage from DungeonFacade to DungeonContext
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move `purge` and `partymax` back into CommandDungeonsGuide
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* stop repeating ReceiveChatQueue in ChatTransmitter
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* Clean up DungeonsGuide
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move `sendDebugChat` to `ChatTransmitter.java`
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* change CommandDgDebug into a `else if` from an `switch` because some bigot decided its better
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* duplicate code since it currently doesn't make sense, to be reworked
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* fix typo
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* remove the trycatch so we fail fast
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* fix null pointer when trying to get fontRenderer before minecraft is initialised
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* broken checkpoint 0
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* broken checkpoint 1
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* Revert "broken checkpoint 1"
This reverts commit 64985e6287c7b5650b509668e42b9803e25c419c.
* Revert "broken checkpoint 0"
This reverts commit 5f62e1345d9c8e7f66f1e5792004a05027913d92.
* Revert "fix null pointer when trying to get fontRenderer before minecraft is initialised"
This reverts commit 57d92a78d31c410f699b58c8995c94055d57e2a4.
* Revert "remove the trycatch so we fail fast"
This reverts commit 12772255ed575e411fb99edf37ec16d0e5f42924.
* Revert "fix typo"
This reverts commit aa96cc2436d3ead42d53ead78f3334fac5100713.
* Revert "duplicate code since it currently doesn't make sense, to be reworked"
This reverts commit 6d71b88e3102d23bcfd90d85e8996327776fd52f.
* Revert "change CommandDgDebug into a `else if` from an `switch` because some bigot decided its better"
This reverts commit ffea84d9b5fd4adbe034a88249bc920eafa7c53a.
* Revert "move `sendDebugChat` to `ChatTransmitter.java`"
This reverts commit 5b8b2e22fff33768134a01c15c7650100ebb9257.
* Revert "Clean up DungeonsGuide"
This reverts commit 2069ad3ebc4344eb1e778954dc1d8f6c9303de69.
* fix typo
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
(cherry picked from commit aa96cc2436d3ead42d53ead78f3334fac5100713)
* duplicate code since it currently doesn't make sense, to be reworked
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
(cherry picked from commit 6d71b88e3102d23bcfd90d85e8996327776fd52f)
* change CommandDgDebug into a `else if` from an `switch` because some bigot decided its better
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
(cherry picked from commit ffea84d9b5fd4adbe034a88249bc920eafa7c53a)
* move debug chat into ChatTransmitter
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* null pointer in SkyblockStatus bc context was not initialised yet
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move dungeon starting door detection up the tree since it was a duplicate in both children, inline MortDetector2000
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move dungeon name to DungeonContext
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* clean up Main
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* separate the "loader" and "mod"
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* separate DungeonsGuide and Main even more
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* change singleton implementation of DungeonsGuide
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move classes since their paths are hardcoded into roomdatas
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* create CatacombsDataProvider.java and implement it
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* remove unnecessary `DungeonsGuide.getDungeonsGuide();` (IntelliJ refactor bug)
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* move `help` text in commands
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* a certain someone hates switch statements
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* remove my version check, since we have to wait for out lord and savior to make his own
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* make `Main` and `DungeonsGuide` compatible with supported jar classloading
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* make the beta upload action run on push
since it didnt get the secret on pull request and failed anyway,
TODO: make the jar name not hardcoded
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
* upload all jar
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
Signed-off-by: kingstefan26 <70776766+kingstefan26@users.noreply.github.com>
Co-authored-by: syeyoung <42869671+cyoung06@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java | 302 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/DGInterface.java | 28 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java | 272 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/GuiLoadingError.java | 21 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/IDungeonGuide.java | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/Main.java | 185 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/YoMamaOutdated.java | 110 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/AuthManager.java | 150 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/AuthUtil.java | 70 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/InvalidDungeonsGuideCredentialsException.java | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/ResourceManager.java | 164 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/AuthProvider.java | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuth.java | 46 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuthUtil.java | 88 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/NullAuth.java | 62 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java | 504 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/Action.java | 40 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/DungeonRoomInfo.java | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java | 21 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPointSet.java | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java | 171 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java | 125 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java | 18 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java | 13 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java | 56 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java | 67 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java | 22 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java | 52 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java | 50 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java | 106 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java | 64 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/dunegonmechanic/DungeonMechanic.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java) | 8 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/dunegonmechanic/RouteBlocker.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/RouteBlocker.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/predicates/PredicateArmorStand.java | 1 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java | 585 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java | 217 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebug.java | 65 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java | 454 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/PlayerSkyblockData.java | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java | 57 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBlaze.java | 46 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java | 260 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/Keybinds.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/Keybinds.java) | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java) | 100 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessResult.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/chat/ChatProcessResult.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/chat/ChatProcessor.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatSubscriber.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/chat/ChatSubscriber.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatTransmitter.java | 69 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java) | 416 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java | 172 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandReparty.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/commands/CommandReparty.java) | 30 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/Config.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/Config.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/ConfigPanelCreator.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/ConfigPanelCreator.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/GuiConfigV2.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfigV2.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MCategory.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MCategory.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MCategoryElement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MCategoryElement.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MFeature.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java) | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MFeatureEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeatureEdit.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MNotFound.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MNotFound.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MPanelCategory.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MPanelCategory.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MParameterEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameterEdit.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/NestedCategory.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/NestedCategory.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/RootConfigPanel.java) | 20 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/GuiGuiLocationConfig.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/Marker.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/PanelDelegate.java) | 19 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/GUIRectangle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/GUIRectangle.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCAColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCAColor.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCBoolean.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCBoolean.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCColor.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCFloat.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCGUIRectangle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCGUIRectangle.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCInteger.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCInteger.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCKeybind.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCKeybind.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCRectangle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCRectangle.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCString.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCString.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCStringList.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCStringList.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCTextStyle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCTextStyle.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCTextStyleList.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TCTextStyleList.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TypeConverter.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TypeConverter.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TypeConverterRegistry.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/config/types/TypeConverterRegistry.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/ActiveCosmetic.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/ActiveCosmetic.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticData.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java) | 138 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CustomNetworkPlayerInfo.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java) | 61 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CustomPacketPlayerListItem.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomPacketPlayerListItem.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/IChatReplacer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/IChatReplacer.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerChatByMe.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerCoop.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerCoop.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerMessage.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerMessage.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerPV.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerPV.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerSocialOptions.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerSocialOptions.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerViewProfile.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java) | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/GameSDK.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/GameSDK.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/GameSDKTypeMapper.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/GameSDKTypeMapper.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/NativeGameSDK.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/NativeGameSDK.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivity.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivity.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityAssets.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityAssets.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityParty.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityParty.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivitySecrets.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivitySecrets.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityTimestamps.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityTimestamps.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordCreateParams.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordCreateParams.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordEntitlement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordEntitlement.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordFileStat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordFileStat.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordImageDimensions.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageDimensions.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordImageHandle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageHandle.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordInputMode.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordInputMode.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordLobby.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordLobby.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordOAuth2Token.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordOAuth2Token.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordPartySize.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPartySize.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordPresence.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPresence.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordRelationship.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordRelationship.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordSku.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSku.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordSkuPrice.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSkuPrice.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordStruct.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordStruct.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordUser.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUser.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordUserAchievement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUserAchievement.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityActionType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityActionType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordCreateFlags.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordCreateFlags.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordEntitlementType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordEntitlementType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordImageType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordImageType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordInputModeType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordInputModeType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbyType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbyType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLogLevel.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLogLevel.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordPremiumType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordPremiumType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordRelationshipType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordRelationshipType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordResult.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordResult.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordSkuType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordSkuType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordStatus.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordStatus.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordUserFlag.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordUserFlag.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/GameSDKCallback.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/GameSDKCallback.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordActivityManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityManager.java) | 19 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordCore.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordCore.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordImageManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordImageManager.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java) | 21 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java) | 15 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java) | 9 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStorageManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStorageManager.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStoreManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreManager.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordUserEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserEvents.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordUserManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserManager.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java) | 15 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordClientID.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordClientID.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordNetworkChannelId.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkChannelId.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordNetworkPeerId.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkPeerId.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordSnowflake.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordSnowflake.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordTimestamp.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordTimestamp.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordVersion.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordVersion.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/Int32.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int32.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/Int64.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int64.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt32.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt32.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt64.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt64.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt8.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt8.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordActivity.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordActivity.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordRelation.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordRelation.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordUser.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordUser.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/RichPresenceManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java) | 42 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonActionContext.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonActionManager.java) | 11 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonContext.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java) | 102 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonFacade.java | 35 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java | 535 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/AbstractAction.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/AbstractAction.java) | 38 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionBreakWithSuperBoom.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java) | 26 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionChangeState.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java) | 29 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionClick.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java) | 20 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionClickSet.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java) | 27 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionComplete.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionComplete.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionDropItem.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java) | 35 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionInteract.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java) | 44 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionKill.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java) | 37 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java) | 46 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java) | 53 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionRoot.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionRoot.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRoute.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java) | 76 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionTree.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java) | 57 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionTreeUtil.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTreeUtil.java) | 8 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonDoor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java) | 22 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonSpecificDataProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProvider.java) | 8 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/EDungeonDoorType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/EDungeonDoorType.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/CatacombsDataProvider.java | 75 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/MasterModeDataProvider.java | 64 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/NormalModeDataProvider.java | 101 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEvent.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEventData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEventData.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEventHolder.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEventHolder.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/SerializableBlockPos.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/SerializableBlockPos.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonCryptBrokenEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonCryptBrokenEvent.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonDeathEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonDeathEvent.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonMapUpdateEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonMapUpdateEvent.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonNodataEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonNodataEvent.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonPuzzleFailureEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonPuzzleFailureEvent.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonRoomDiscoverEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonRoomDiscoverEvent.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonSecretCountChangeEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonSecretCountChangeEvent.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonStateChangeEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonStateChangeEvent.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/map/DungeonMapData.java | 121 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/AStarCornerCut.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/pathfinding/AStarCornerCut.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/AStarFineGrid.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/pathfinding/AStarFineGrid.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/CachedWorld.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/pathfinding/CachedWorld.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/JPSPathfinder.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java) | 9 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/NodeProcessorDungeonRoom.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java) | 88 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/ThetaStar.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/pathfinding/ThetaStar.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/EditingContext.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/EditingContext.java) | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/Parameter.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/Parameter.java) | 3 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java) | 19 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java) | 30 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java) | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java) | 28 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditBreakableWall.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditDoor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditDummy.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDummy.java) | 23 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditFairySoul.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditFairySoul.java) | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditJournal.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditJournal.java) | 23 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditLever.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditNPC.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditNPC.java) | 24 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditOnewayDoor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayDoor.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditOnewayLever.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java) | 22 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditPressurePlate.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java) | 22 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditSecret.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditSecret.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditTomb.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ActionDisplayPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ActionTreeDisplayPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java) | 25 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/DynamicEditor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/DynamicEditor.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/GeneralEditPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java) | 25 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ProcessorParameterEditPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ProcessorParameterEditPane.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoomDataDisplayPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java) | 7 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoomMatchDisplayPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoommatchingPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoommatchingPane.java) | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/SecretEditPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/SecretEditPane.java) | 18 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEdit.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditAColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java) | 14 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditBoolean.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditBoolean.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java) | 8 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditCreator.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditCreator.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditFloat.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditInteger.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditInteger.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditNull.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditNull.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditOffsetPoint.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditOffsetPointSet.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPointSet.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditRegistry.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditRegistry.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditString.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditString.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java) | 68 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoomInfoRegistry.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java) | 44 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/RoomMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java) | 22 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java) | 72 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/ProcessorFactory.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java) | 8 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorBlazeSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java) | 29 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorButtonSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorButtonSolver.java) | 7 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorCreeperSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorCreeperSolver.java) | 17 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorGenerator.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorGenerator.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorRedRoom.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java) | 18 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorRiddle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java) | 16 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java) | 18 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTicTacToeSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java) | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTrivia.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java) | 28 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java) | 44 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/BDChamber.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/BDChamber.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/BombDefuseChamberGenerator.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/BombDefuseChamberGenerator.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/ChamberProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/ChamberProcessor.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/DummyDefuseChamberProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/DummyDefuseChamberProcessor.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/bugged/ImpossibleMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/bugged/ImpossibleMatcher.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java) | 15 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java) | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathProcessorMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathProcessorMatcher.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java) | 23 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java) | 13 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorBonzo.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorLivid.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorNecron.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorProf.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorSadan.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorScarf.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorThorn.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/GeneralBossfightProcessor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/HealthData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java) | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java) | 24 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java) | 25 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/LeverState.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/LeverState.java) | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/LeverStateContradict.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/LeverStateContradict.java) | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/RoomProcessorWaterPuzzle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/RoomProcessorWaterPuzzle.java) | 12 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/Route.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/Route.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/SwitchData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/SwitchData.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/WaterBoard.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/WaterBoard.java) | 7 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/WaterNode.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/WaterNode.java) | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeAir.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeAir.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeEnd.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeEnd.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeStart.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeStart.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeToggleable.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeToggleable.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeWall.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeWall.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/AuthChangedEvent.java | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/BlockUpdateEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/BlockUpdateEvent.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/BossroomEnterEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/BossroomEnterEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DiscordUserJoinRequestEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/DiscordUserJoinRequestEvent.java) | 9 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DiscordUserUpdateEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/DiscordUserUpdateEvent.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonContextInitializationEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/DungeonContextInitializationEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonEndedEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/DungeonEndedEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonLeftEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/DungeonLeftEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonStartedEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/DungeonStartedEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/HypixelJoinedEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/HypixelJoinedEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/KeyBindPressedEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/KeyBindPressedEvent.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/PlayerInteractEntityEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/PlayerInteractEntityEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/PlayerListItemPacketEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/PlayerListItemPacketEvent.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/SkyblockJoinedEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/SkyblockJoinedEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/SkyblockLeftEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/SkyblockLeftEvent.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/StompConnectedEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/StompConnectedEvent.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/TitleEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/TitleEvent.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/WindowUpdateEvent.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/events/WindowUpdateEvent.java) | 5 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java | 513 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/FeatureListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java) | 90 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/eventlistener/PacketListener.java) | 34 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractFeature.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java) | 21 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureParameter.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java) | 35 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java | 337 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/GuiFeature.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/SimpleFeature.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/SimpleFeature.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebug.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureCollectScore.java) | 15 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java | 80 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java) | 25 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java) | 35 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPepole.java | 460 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureAutoReparty.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java) | 51 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java) | 34 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java) | 49 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java) | 24 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java) | 22 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java) | 31 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java) | 40 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/CorrectThePaneSolutionProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/CorrectThePaneSolutionProvider.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java) | 38 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/NavigateMazeSolutionProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/NavigateMazeSolutionProvider.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/SelectAllColorSolutionProivider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/SelectAllColorSolutionProivider.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/SelectInOrderSolutionProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/SelectInOrderSolutionProvider.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/TerminalSolution.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/TerminalSolution.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/TerminalSolutionProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/TerminalSolutionProvider.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/WhatStartsWithSolutionProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/WhatStartsWithSolutionProvider.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/FeatureNicknameColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/FeatureNicknamePrefix.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/PrefixSelectorGUI.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/ImageTexture.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/ImageTexture.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/PartyInviteViewer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyInviteViewer.java) | 24 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/PartyJoinRequest.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/invteTooltip/MTooltipInvite.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java) | 23 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/invteTooltip/MTooltipInviteElement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/onlinealarm/PlayingDGAlarm.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java) | 29 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureCollectScore.java | 77 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java) | 22 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java) | 39 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java | 508 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java) | 29 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java) | 19 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java) | 31 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSBTime.java) | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java) | 52 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java) | 31 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonTombs.java) | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureHideNameTags.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java) | 24 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureCooldownCounter.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java) | 24 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureCopyMessages.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDecreaseExplosionSound.java) | 17 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDisableMessage.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java | 156 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java) | 26 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureRepartyCommand.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureRepartyCommand.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureTooltipDungeonStat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipDungeonStat.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureTooltipPrice.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureUpdateAlarm.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java) | 45 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/FeatureAbilityCooldown.java) | 31 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/SkyblockAbility.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/SkyblockAbility.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/UsedAbility.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/UsedAbility.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/APIKey.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/APIKey.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeatureGoodParties.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeaturePartyList.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeaturePartyReady.java) | 27 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/FeatureCustomPartyFinder.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/GuiCustomPartyFinder.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/GuiCustomPartyFinder.java) | 9 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyFinder.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java) | 22 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyFinderSettings.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java) | 15 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyListElement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java) | 19 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/FakePlayer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FakePlayer.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/FeatureViewPlayerStatsOnJoin.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerStatsOnJoin.java) | 399 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/ApiFetcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/ApiFetcher.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/CachedData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/CachedData.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/PlayerSkyblockData.java | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/SkinFetcher.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/SkinFetcher.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/PlayerProfile.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/PlayerProfile.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/PlayerProfileParser.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/PlayerProfileParser.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/ClassSpecificData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/ClassSpecificData.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonClass.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonClass.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonSpecificData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonSpecificData.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonStat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonStat.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonType.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonType.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/FloorSpecificData.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/FloorSpecificData.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/Pet.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/Pet.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/Skill.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/Skill.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/DataRendererEditor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/DataRendererEditor.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/DataRendererRegistry.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/DataRendererRegistry.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/IDataRenderer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/IDataRenderer.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonFloorStat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonFloorStat.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonHighestFloorStat.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonHighestFloorStat.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererClassLv.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererClassLv.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererDungeonLv.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererDungeonLv.java) | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererFairySouls.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererFairySouls.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererLilyWeight.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererLilyWeight.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSecrets.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSecrets.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSelectedClassLv.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSelectedClassLv.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSetUrOwn.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSetUrOwn.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSkillLv.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSkillLv.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererTalismans.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererTalismans.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java) | 39 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureBloodRush.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureBloodRush.java) | 20 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureCreateRefreshLine.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureCreateRefreshLine.java) | 27 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureFreezePathfind.java | 45 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeaturePathfindStrategy.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindStrategy.java) | 26 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeaturePathfindToAll.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java) | 16 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java) | 53 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureTogglePathfind.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureTogglePathfind.java) | 28 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java) | 42 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java) | 57 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MechanicBrowserElement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MechanicBrowserElement.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MechanicBrowserTooltip.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MechanicBrowserTooltip.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java) | 50 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBlaze.java | 51 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBombdefuse.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBombdefuse.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBox.java) | 22 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverIcefill.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverKahoot.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverKahoot.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverRiddle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverRiddle.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverSilverfish.java) | 22 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverTeleport.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTeleport.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverTictactoe.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTictactoe.java) | 14 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/BossroomEnterListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/BossroomEnterListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ChatListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/ChatListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ChatListenerGlobal.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/ChatListenerGlobal.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DiscordUserJoinRequestListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/DiscordUserJoinRequestListener.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DiscordUserUpdateListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/DiscordUserUpdateListener.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonContextInitializationListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonContextInitializationListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonEndListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonEndListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonQuitListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonQuitListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonStartListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonStartListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/EntityLivingRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/EntityLivingRenderListener.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiBackgroundRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiBackgroundRenderListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiClickListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiClickListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiOpenListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiOpenListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiPostRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiPostRenderListener.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiPreRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiPreRenderListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiUpdateListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiUpdateListener.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/InteractListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/InteractListener.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/KeyInputListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/KeyInputListener.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/KeybindPressedListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/KeybindPressedListener.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/PlayerRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ScreenRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/ScreenRenderListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SkyblockJoinListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/SkyblockJoinListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SkyblockLeaveListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/SkyblockLeaveListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SoundListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/SoundListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/StompConnectedListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/StompConnectedListener.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TextureStichListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/TextureStichListener.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TickListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/TickListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TitleListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/TitleListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TooltipListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/TooltipListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/WorldRenderListener.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/listener/WorldRenderListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/PanelTextParameterConfig.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java) | 19 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledText.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledText.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledTextProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextProvider.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledTextRenderer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java) | 32 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/MGui.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/MGui.java) | 92 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/MPanel.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MButton.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MCollapsable.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MCollapsable.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MColor.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MEditableAColor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MEditableAColor.java) | 9 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MFloatSelectionButton.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MIntegerSelectionButton.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MKeyEditButton.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MKeyEditButton.java) | 9 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MLabel.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MLabelAndElement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabelAndElement.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MList.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MList.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModal.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModal.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModalConfirmation.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalConfirmation.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModalMessage.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalMessage.java) | 6 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MNavigatingPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPanelScaledGUI.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPanelScaledGUI.java) | 5 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MParameter.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MParameter.java) | 13 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPassiveLabelAndElement.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPopupMenu.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPopupMenu.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPortableColorEdit.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java) | 10 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MRootPanel.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MRootPanel.java) | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MScrollBar.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MScrollBar.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MScrollablePanel.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MScrollablePanel.java) | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MSpacer.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MSpacer.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MStringSelectionButton.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MStringSelectionButton.java) | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTabbedPane.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java) | 5 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTextField.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java) | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MToggleButton.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTooltip.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTooltip.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTooltipText.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTooltipText.java) | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MValue.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MValue.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyContext.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/chat/PartyContext.java) | 19 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java) | 491 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/resources/DGTexturePack.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java) | 9 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/FailedWebSocketConnection.java | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompClient.java | 192 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompDiedEvent.java | 15 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompHeader.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/stomp/StompHeader.java) | 5 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompManager.java | 73 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompPayload.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java) | 24 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompSubscription.java | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/AhUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/AhUtils.java) | 33 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ArrayUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/ArrayUtils.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/BlockCache.java | 50 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/GlStateUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/GlStateUtils.java) | 3 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/MapUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java) | 3 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/RenderUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java) | 11 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ScoreBoardUtils.java | 58 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ShortUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/ShortUtils.java) | 2 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/SkyblockUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/SkyblockUtils.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TabListUtil.java | 75 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TextUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TimeScoreUtil.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/TimeScoreUtil.java) | 7 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TitleRender.java | 139 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/VectorUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/VectorUtils.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/XPUtils.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/XPUtils.java) | 4 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/CursorReader.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java) | 12 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/EnumCursor.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/EnumCursor.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/Foundation.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/Foundation.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/GLCursors.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java) | 33 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/User32.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/User32.java) | 3 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/X11.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/X11.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/wsresource/StaticResource.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/wsresource/StaticResource.java) | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/mod/wsresource/StaticResourceCache.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/wsresource/StaticResourceCache.java) | 42 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/stomp/CloseListener.java | 23 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClient.java | 194 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClientStatus.java | 23 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/stomp/StompInterface.java | 26 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/stomp/StompMessageHandler.java | 23 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/stomp/StompSubscription.java | 41 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/url/DGConnection.java | 18 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandler.java | 4 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandlerFactory.java | 4 | ||||
-rw-r--r-- | src/main/resources/assets/dg/textures/dglogox128.png | bin | 0 -> 3024 bytes | |||
-rw-r--r-- | src/main/resources/assets/dg/textures/dglogox32.png | bin | 0 -> 648 bytes | |||
-rw-r--r-- | src/main/resources/assets/skyblock_dungeons_guide/sounds.json | 10 | ||||
-rw-r--r-- | src/main/resources/assets/skyblock_dungeons_guide/sounds/readysetgo.ogg | bin | 0 -> 161265 bytes | |||
-rwxr-xr-x | src/main/resources/mcmod.info | 6 |
602 files changed, 9215 insertions, 7678 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java b/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java deleted file mode 100755 index 5b15fde6..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/Authenticator.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.exceptions.AuthenticationException; -import com.mojang.authlib.minecraft.MinecraftSessionService; -import net.minecraft.client.Minecraft; -import net.minecraft.util.Session; -import net.minecraftforge.fml.common.ProgressManager; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.io.IOUtils; - -import javax.crypto.*; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import javax.net.ssl.*; -import java.io.*; -import java.math.BigInteger; -import java.net.*; -import java.security.*; -import java.security.cert.CertificateException; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.X509EncodedKeySpec; -import java.util.HashMap; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -public class Authenticator { - private KeyPair rsaKey; - private String token; - private final ProgressManager.ProgressBar progressBar; - - public String getToken() { - return token; - } - - private KeyPair getKeyPair() { - KeyPairGenerator a = null; - try { - a = KeyPairGenerator.getInstance("RSA"); - } catch (NoSuchAlgorithmException b) { } - a.initialize(1024); - this.rsaKey = a.generateKeyPair(); - return this.rsaKey; - } - - private PublicKey dgPublicKey; - private PublicKey getDGPublicKey() throws NoSuchAlgorithmException, InvalidKeySpecException { - if (dgPublicKey != null) return dgPublicKey; - X509EncodedKeySpec spec = new X509EncodedKeySpec(Base64.decodeBase64("MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxO89qtwG67jNucQ9Y44c" + - "IUs/B+5BeJPs7G+RG2gfs4/2+tzF/c1FLDc33M7yKw8aKk99vsBUY9Oo8gxxiEPB" + - "JitP/qfon2THp94oM77ZTpHlmFoqbZMcKGZVI8yfvEL4laTM8Hw+qh5poQwtpEbK" + - "Xo47AkxygxJasUnykER2+aSTZ6kWU2D4xiNtFA6lzqN+/oA+NaYfPS0amAvyVlHR" + - "n/8IuGkxb5RrlqVssQstFnxsJuv88qdGSEqlcKq2tLeg9hb8eCnl2OFzvXmgbVER" + - "0JaV+4Z02fVG1IlR3Xo1mSit7yIU6++3usRCjx2yfXpnGGJUW5pe6YETjNew3ax+" + - "FAZ4GePWCdmS7FvBnbbABKo5pE06ZTfDUTCjQlAJQiUgoF6ntMJvQAXPu48Vr8q/" + - "mTcuZWVnI6CDgyE7nNq3WNoq3397sBzxRohMxuqzl3T19zkfPKF05iV2Ju1HQMW5" + - "I119bYrmVD240aGESZc20Sx/9g1BFpNzQbM5PGUlWJ0dhLjl2ge4ip2hHciY3OEY" + - "p2Qy2k+xEdenpKdL+WMRimCQoO9gWe2Tp4NmP5dppDXZgPjXqjZpnGs0Uxs+fXqW" + - "cwlg3MbX3rFl9so/fhVf4p9oXZK3ve7z5D6XSSDRYECvsKIa08WAxJ/U6n204E/4" + - "xUF+3ZgFPdzZGn2PU7SsnOsCAwEAAQ==")); - return dgPublicKey = KeyFactory.getInstance("RSA").generatePublic(spec); - } - - public Authenticator(ProgressManager.ProgressBar progressBar) { - this.progressBar = progressBar; - progressBar.step("Generating KeyPair"); - getKeyPair(); - } - - public String authenticateAndDownload(String version) throws IOException, AuthenticationException, NoSuchAlgorithmException, CertificateException, KeyStoreException, KeyManagementException, InvalidKeySpecException, SignatureException { - Session session = Minecraft.getMinecraft().getSession(); - String sessionToken = session.getToken(); - - progressBar.step("Authenticating (1/2)"); - String tempToken = requestAuth(session.getProfile()); - MinecraftSessionService yggdrasilMinecraftSessionService = Minecraft.getMinecraft().getSessionService(); - JsonObject d = getJwtPayload(tempToken); - String hash = calculateServerHash(Base64.decodeBase64(d.get("sharedSecret").getAsString()), - Base64.decodeBase64(d.get("publicKey").getAsString())); - yggdrasilMinecraftSessionService.joinServer(session.getProfile(), sessionToken, hash); - progressBar.step("Authenticating (2/2)"); - this.token = verifyAuth(tempToken, this.rsaKey.getPublic()); - try { - progressBar.step("Downloading Jar"); - if (version != null) - downloadSafe(this.token, "https://dungeons.guide/resource/version?v=" + version, true); - progressBar.step("Downloading Rooms"); - downloadSafe(this.token, "https://dungeons.guide/resource/roomdata", false); - } catch (Throwable t) { - t.printStackTrace(); - } - return this.token; - } - - public JsonObject getJwtPayload(String jwt) { - String midPart = jwt.split("\\.")[1].replace("+", "-").replace("/", "_"); - String base64Decode = new String(Base64.decodeBase64(midPart)); // padding - return (JsonObject) new JsonParser().parse(base64Decode); - } - - - - private String requestAuth(GameProfile profile) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException, KeyManagementException { - HttpsURLConnection connection = (HttpsURLConnection) new URL("https://dungeons.guide/auth/requestAuth").openConnection(); - connection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); - connection.setRequestProperty("Content-Type", "application/json"); - connection.setRequestMethod("POST"); - connection.setDoInput(true); - connection.setDoOutput(true); - - connection.getOutputStream().write(("{\"uuid\":\""+profile.getId().toString()+"\",\"nickname\":\""+profile.getName()+"\"}").getBytes()); - String payload = String.join("\n", IOUtils.readLines(connection.getErrorStream() == null ? connection.getInputStream() : connection.getErrorStream())); - if (connection.getResponseCode() >= 400) - System.out.println("https://dungeons.guide/auth/requestAuth :: Received "+connection.getResponseCode()+" along with\n"+payload); - - JsonObject json = (JsonObject) new JsonParser().parse(payload); - - if (!"ok".equals(json.get("status").getAsString())) { - return null; - } - return json.get("data").getAsString(); - } - private String verifyAuth(String tempToken, PublicKey clientKey) throws IOException { - HttpsURLConnection urlConnection = (HttpsURLConnection) new URL("https://dungeons.guide/auth/authenticate").openConnection(); - urlConnection.setRequestMethod("POST"); - urlConnection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); - urlConnection.setRequestProperty("Content-Type", "application/json"); - urlConnection.setDoInput(true); - urlConnection.setDoOutput(true); - - urlConnection.getOutputStream().write(("{\"jwt\":\""+tempToken+"\",\"publicKey\":\""+Base64.encodeBase64URLSafeString(clientKey.getEncoded())+"\"}").getBytes()); - String payload = String.join("\n", IOUtils.readLines(urlConnection.getErrorStream() == null ? urlConnection.getInputStream() : urlConnection.getErrorStream())); - if (urlConnection.getResponseCode() >= 400) - System.out.println("https://dungeons.guide/auth/authenticate :: Received "+urlConnection.getResponseCode()+" along with\n"+payload); - - JsonObject jsonObject = (JsonObject) new JsonParser().parse(payload); - if (!"ok".equals(jsonObject.get("status").getAsString())) { - return null; - } - return jsonObject.get("data").getAsString(); - } - - private final HashMap<String, byte[]> loadedResources = new HashMap<String, byte[]>(); - - public HashMap<String, byte[]> getResources() { - return loadedResources; - } - - private void downloadSafe(String dgToken, String url, boolean isValidateSignature) throws IOException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException, CertificateException, KeyStoreException, KeyManagementException, SignatureException, InvalidKeySpecException { - HttpsURLConnection dgConnection = (HttpsURLConnection) new URL(url).openConnection(); - dgConnection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); - dgConnection.setRequestProperty("Content-Type", "application/json"); - dgConnection.setRequestMethod("GET"); - dgConnection.setRequestProperty("Authorization", dgToken); - dgConnection.setDoInput(true); - dgConnection.setDoOutput(true); - - InputStream inputStream = dgConnection.getInputStream(); - byte[] lengthBytes = new byte[4]; - inputStream.read(lengthBytes); - int length = ((lengthBytes[0] & 0xFF) << 24) | - ((lengthBytes[1] & 0xFF) << 16) | - ((lengthBytes[2] & 0xFF) << 8) | - ((lengthBytes[3] & 0xFF)); - while (inputStream.available() < length) ; - byte[] keyPayload = new byte[length]; - inputStream.read(keyPayload); - - Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); - cipher.init(Cipher.DECRYPT_MODE, this.rsaKey.getPrivate()); - byte[] h = cipher.doFinal(keyPayload); - - cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); - SecretKeySpec keySpec = new SecretKeySpec(h, "AES"); - IvParameterSpec ivSpec = new IvParameterSpec(h); - cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); - CipherInputStream cipherInputStream = new CipherInputStream(inputStream, cipher); - - cipherInputStream.read(lengthBytes); - length = ((lengthBytes[0] & 0xFF) << 24) | - ((lengthBytes[1] & 0xFF) << 16) | - ((lengthBytes[2] & 0xFF) << 8) | - ((lengthBytes[3] & 0xFF)); - - int totalLen = length; - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - byte[] buff = new byte[256]; - while (totalLen > 0) { - int len = cipherInputStream.read(buff, 0, Math.min(buff.length, totalLen)); - totalLen -= len; - bos.write(buff, 0, len); - } - byte[] body = bos.toByteArray(); - - byte[] signed = null; - if (isValidateSignature) { - progressBar.step("Validating Signature"); - cipherInputStream.read(lengthBytes,0 , 4); - length = ((lengthBytes[0] & 0xFF) << 24) | - ((lengthBytes[1] & 0xFF) << 16) | - ((lengthBytes[2] & 0xFF) << 8) | - ((lengthBytes[3] & 0xFF)); - - totalLen = length; - bos = new ByteArrayOutputStream(); - while (totalLen > 0) { - int len = cipherInputStream.read(buff, 0, Math.min(buff.length, totalLen)); - totalLen -= len; - bos.write(buff, 0, len); - } - signed = bos.toByteArray(); - - Signature sign = Signature.getInstance("SHA512withRSA"); - sign.initVerify(getDGPublicKey()); - sign.update(body); - boolean truth = sign.verify(signed); - if (!truth) throw new SignatureException("DG SIGNATURE FORGED"); - } - - ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(body)); - ZipEntry zipEntry; - while ((zipEntry=zipInputStream.getNextEntry()) != null) { - byte[] buffer = new byte[256]; - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - int p = 0; - while((p = zipInputStream.read(buffer)) > 0) { - byteArrayOutputStream.write(buffer, 0, p); - } - this.loadedResources.put(zipEntry.getName(), byteArrayOutputStream.toByteArray()); - } - dgConnection.disconnect(); - } - - public JsonElement getJsonSecured(String u) throws IOException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException, CertificateException, KeyStoreException, KeyManagementException { - HttpsURLConnection httpsURLConnection = (HttpsURLConnection) new URL(u).openConnection(); - httpsURLConnection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); - httpsURLConnection.setRequestProperty("Content-Type", "application/json"); - httpsURLConnection.setRequestMethod("GET"); - httpsURLConnection.setRequestProperty("Authorization", this.token); - httpsURLConnection.setDoInput(true); - httpsURLConnection.setDoOutput(true); - - InputStream inputStream = httpsURLConnection.getInputStream(); - byte[] lengthPayload = new byte[4]; - inputStream.read(lengthPayload); - int length = ((lengthPayload[0] & 0xFF) << 24) | - ((lengthPayload[1] & 0xFF) << 16) | - ((lengthPayload[2] & 0xFF) << 8) | - ((lengthPayload[3] & 0xFF)); - while (inputStream.available() < length) ; - byte[] keyPayload = new byte[length]; - inputStream.read(keyPayload); - - Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); - cipher.init(Cipher.DECRYPT_MODE, this.rsaKey.getPrivate()); - byte[] AESKey = cipher.doFinal(keyPayload); - - cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); - SecretKeySpec secretKeySpec = new SecretKeySpec(AESKey, "AES"); - IvParameterSpec ivParameterSpec = new IvParameterSpec(AESKey); - cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec); - CipherInputStream cipherInputStream = new CipherInputStream(inputStream, cipher); - cipherInputStream.read(lengthPayload); - length = ((lengthPayload[0] & 0xFF) << 24) | - ((lengthPayload[1] & 0xFF) << 16) | - ((lengthPayload[2] & 0xFF) << 8) | - ((lengthPayload[3] & 0xFF)); - JsonElement l = new JsonParser().parse(new InputStreamReader(cipherInputStream)); - httpsURLConnection.disconnect(); - return l; - } - - public String calculateServerHash(byte[] a, byte[] b) throws NoSuchAlgorithmException { - MessageDigest c = MessageDigest.getInstance("SHA-1"); - c.update("".getBytes()); - c.update(a); - c.update(b); - byte[] d = c.digest(); - return new BigInteger(d).toString(16); - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DGInterface.java b/src/main/java/kr/syeyoung/dungeonsguide/DGInterface.java deleted file mode 100755 index 0529f0a6..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/DGInterface.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide; - -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; - -public interface DGInterface { - void init(FMLInitializationEvent event); - - void pre(FMLPreInitializationEvent event); -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java deleted file mode 100755 index f1c8b3a9..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide; - -import com.google.common.collect.Sets; -import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.chat.ChatProcessor; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.commands.*; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; -import kr.syeyoung.dungeonsguide.eventlistener.DungeonListener; -import kr.syeyoung.dungeonsguide.eventlistener.FeatureListener; -import kr.syeyoung.dungeonsguide.eventlistener.PacketListener; -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.resources.DGTexturePack; -import kr.syeyoung.dungeonsguide.rpc.RichPresenceManager; -import kr.syeyoung.dungeonsguide.stomp.CloseListener; -import kr.syeyoung.dungeonsguide.stomp.StompClient; -import kr.syeyoung.dungeonsguide.stomp.StompInterface; -import kr.syeyoung.dungeonsguide.utils.AhUtils; -import kr.syeyoung.dungeonsguide.utils.TimeScoreUtil; -import kr.syeyoung.dungeonsguide.utils.cursor.GLCursors; -import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; -import lombok.Getter; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiErrorScreen; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.resources.IReloadableResourceManager; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.client.resources.IResourcePack; -import net.minecraft.launchwrapper.LaunchClassLoader; -import net.minecraft.util.IChatComponent; -import net.minecraftforge.client.ClientCommandHandler; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.ProgressManager; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.relauncher.ReflectionHelper; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import java.io.*; -import java.net.URI; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.List; -import java.util.Set; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -public class DungeonsGuide implements DGInterface, CloseListener { - - private SkyblockStatus skyblockStatus; - - private static DungeonsGuide dungeonsGuide; - - - @Getter - private final Authenticator authenticator; - - @Getter - private StompInterface stompConnection; - @Getter - private CosmeticsManager cosmeticsManager; - - public DungeonsGuide(Authenticator authenticator) { - this.authenticator = authenticator; - } - - public static void sendDebugChat(IChatComponent iChatComponent) { - if (FeatureRegistry.DEBUG.isEnabled()) - Minecraft.getMinecraft().thePlayer.addChatMessage(iChatComponent); - } - @Getter - CommandReparty commandReparty; - - - private final String stompURL = "wss://dungeons.guide/ws"; -// private String stompURL = "ws://localhost/ws"; - public void init(FMLInitializationEvent event) { - ProgressManager.ProgressBar progressbar = ProgressManager.push("DungeonsGuide", 4); - - - try { - Set<String> invalid = ReflectionHelper.getPrivateValue(LaunchClassLoader.class, (LaunchClassLoader) Main.class.getClassLoader(), "invalidClasses"); - ((LaunchClassLoader) Main.class.getClassLoader()).clearNegativeEntries(Sets.newHashSet("org.slf4j.LoggerFactory")); - invalid.clear(); - } catch (Throwable t) { - t.printStackTrace(); - } - - progressbar.step("Registering Events & Commands"); - dungeonsGuide = this; - skyblockStatus = new SkyblockStatus(); - - CommandDungeonsGuide commandDungeonsGuide; - MinecraftForge.EVENT_BUS.register(new DungeonListener()); - ClientCommandHandler.instance.registerCommand(commandDungeonsGuide = new CommandDungeonsGuide()); - MinecraftForge.EVENT_BUS.register(commandDungeonsGuide); - - commandReparty = new CommandReparty(); - MinecraftForge.EVENT_BUS.register(commandReparty); - - MinecraftForge.EVENT_BUS.register(new FeatureListener()); - MinecraftForge.EVENT_BUS.register(new PacketListener()); - MinecraftForge.EVENT_BUS.register(new Keybinds()); - -// MinecraftForge.EVENT_BUS.register(PartyManager.INSTANCE); - MinecraftForge.EVENT_BUS.register(ChatProcessor.INSTANCE); - MinecraftForge.EVENT_BUS.register(PartyManager.INSTANCE); - MinecraftForge.EVENT_BUS.register(StaticResourceCache.INSTANCE); - - AhUtils.registerTimer(); - - progressbar.step("Loading Roomdatas"); - try { - DungeonRoomInfoRegistry.loadAll(configDir); - } catch (BadPaddingException | InvalidKeyException | NoSuchPaddingException | IllegalBlockSizeException | IOException | NoSuchAlgorithmException | InvalidAlgorithmParameterException e) { - e.printStackTrace(); - } - progressbar.step("Opening connection"); - - cosmeticsManager = new CosmeticsManager(); - MinecraftForge.EVENT_BUS.register(cosmeticsManager); - - try { - connectStomp(); - } catch (Exception e) { - throw new RuntimeException(e); - } - - - progressbar.step("Loading Config"); - try { - Config.loadConfig( null ); - } catch (IOException e) { - e.printStackTrace(); - } - - if (FeatureRegistry.ETC_REPARTY.isEnabled()) - ClientCommandHandler.instance.registerCommand(commandReparty); - if (FeatureRegistry.DISCORD_DONOTUSE.isEnabled()) - System.setProperty("dg.safe", "true"); - MinecraftForge.EVENT_BUS.register(RichPresenceManager.INSTANCE); - TimeScoreUtil.init(); - - ProgressManager.pop(progressbar); - - ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(resourceManager -> GLCursors.setupCursors()); - } - @Getter - private boolean firstTimeUsingDG = false; - public void pre(FMLPreInitializationEvent event) { - t.start(); - configDir = new File(event.getModConfigurationDirectory(),"dungeonsguide"); - File configFile = new File(configDir, "config.json"); - if (!configFile.exists()) { - configDir.mkdirs(); - firstTimeUsingDG = true; - } - Config.f = configFile; - Minecraft.getMinecraft().getFramebuffer().enableStencil(); - - try { - List<IResourcePack> resourcePackList = ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(),"defaultResourcePacks", "aA", "field_110449_ao"); - resourcePackList.add(new DGTexturePack(authenticator)); - Minecraft.getMinecraft().refreshResources(); - } catch (Throwable t){ - t.printStackTrace(); - } - } - - @Getter - private File configDir; - - - public SkyblockStatus getSkyblockStatus() { - return skyblockStatus; - } - - public static DungeonsGuide getDungeonsGuide() { - return dungeonsGuide; - } - ScheduledExecutorService ex = Executors.newScheduledThreadPool(2); - @Override - public void onClose(int code, String reason, boolean remote) { - System.out.println("Stomp Connection closed, trying to reconnect - "+reason+ " - "+code); - connectStomp(); - } - - public void connectStomp() { - ex.schedule(() -> { - try { - stompConnection = new StompClient(new URI(stompURL), authenticator.getToken(), DungeonsGuide.this); - MinecraftForge.EVENT_BUS.post(new StompConnectedEvent(stompConnection)); - } catch (Exception e) { - e.printStackTrace(); - } - }, 5L, TimeUnit.SECONDS); - } - - private Thread t = new Thread(new Runnable() { - @Override - public void run() { - while (true) { - JsonObject obj = DungeonsGuide.getDungeonsGuide().getAuthenticator().getJwtPayload(DungeonsGuide.getDungeonsGuide().getAuthenticator().getToken()); - if (!obj.get("uuid").getAsString().equals(Minecraft.getMinecraft().getSession().getPlayerID())) { - if (Minecraft.getMinecraft().currentScreen instanceof GuiErrorScreen) return; - - final String[] a = new String[]{ - "User has changed current Minecraft session.", - "Please restart mc to revalidate Dungeons Guide", - "Hopefully this screen will be fixed in later release" - }; - final GuiScreen b = new GuiErrorScreen(null, null) { - @Override - public void drawScreen(int par1, int par2, float par3) { - super.drawScreen(par1, par2, par3); - for (int i = 0; i < a.length; ++i) { - drawCenteredString(fontRendererObj, a[i], width / 2, height / 3 + 12 * i, 0xFFFFFFFF); - } - } - - @Override - public void initGui() { - super.initGui(); - this.buttonList.clear(); - this.buttonList.add(new GuiButton(0, width / 2 - 50, height - 50, 100, 20, "close")); - } - - @Override - protected void actionPerformed(GuiButton button) { - FMLCommonHandler.instance().exitJava(-1, true); - } - }; - Minecraft.getMinecraft().displayGuiScreen(b); - return; - } - try { - Thread.sleep(100L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - }); -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/GuiLoadingError.java b/src/main/java/kr/syeyoung/dungeonsguide/GuiLoadingError.java index 4adb2624..68ce5262 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/GuiLoadingError.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/GuiLoadingError.java @@ -18,23 +18,26 @@ package kr.syeyoung.dungeonsguide; -import kr.syeyoung.dungeonsguide.gui.MPanel; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.*; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.FMLCommonHandler; import org.lwjgl.opengl.GL11; +import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.io.PrintStream; public class GuiLoadingError extends GuiScreen { - private String stacktrace; - private Throwable throwable; - private GuiScreen originalGUI; - public GuiLoadingError(Throwable t, String stacktrace, GuiScreen originalGUI) { - this.throwable = t; - this.stacktrace = stacktrace; + static Throwable cause; + private final String stacktrace; + private final GuiScreen originalGUI; + public GuiLoadingError(GuiScreen originalGUI) { + + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + PrintStream printStream = new PrintStream(byteArrayOutputStream); + cause.printStackTrace(printStream); + this.stacktrace = byteArrayOutputStream.toString(); + this.originalGUI = originalGUI; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/IDungeonGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/IDungeonGuide.java new file mode 100644 index 00000000..a568d827 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/IDungeonGuide.java @@ -0,0 +1,10 @@ +package kr.syeyoung.dungeonsguide; + +/** + * This exists, so we can reload the mod/ download a more recent version + */ +public interface IDungeonGuide { + void init(); + void preinit(); + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/Main.java b/src/main/java/kr/syeyoung/dungeonsguide/Main.java index 29ac0599..5cfc0622 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/Main.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/Main.java @@ -18,11 +18,13 @@ package kr.syeyoung.dungeonsguide; -import com.mojang.authlib.exceptions.AuthenticationException; +import kr.syeyoung.dungeonsguide.auth.AuthManager; +import kr.syeyoung.dungeonsguide.auth.InvalidDungeonsGuideCredentialsException; +import kr.syeyoung.dungeonsguide.auth.ResourceManager; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; import kr.syeyoung.dungeonsguide.url.DGStreamHandlerFactory; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; -import kr.syeyoung.dungeonsguide.utils.cursor.GLCursors; -import net.minecraft.client.gui.*; +import lombok.Getter; +import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.common.MinecraftForge; @@ -33,110 +35,135 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; -import java.io.*; -import java.lang.reflect.InvocationTargetException; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; -import java.security.*; -import java.security.cert.CertificateException; -import java.security.spec.InvalidKeySpecException; @Mod(modid = Main.MOD_ID, version = Main.VERSION) -public class Main -{ +public class Main { + public static final String MOD_ID = "skyblock_dungeons_guide"; - public static final String VERSION = "1.0"; + public static final String VERSION = "3.8.0"; + Logger logger = LogManager.getLogger("DG-main"); - private static Main main; - private DGInterface dgInterface; + IDungeonGuide dgInstance; private boolean isLoaded = false; - private Throwable cause; - private String stacktrace; - private boolean showedError = false; - + public static final String SERVER_URL = "https://dungeons.guide"; + public static final String SOME_FUNNY_KEY_THING = "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxO89qtwG67jNucQ9Y44c" + + "IUs/B+5BeJPs7G+RG2gfs4/2+tzF/c1FLDc33M7yKw8aKk99vsBUY9Oo8gxxiEPB" + + "JitP/qfon2THp94oM77ZTpHlmFoqbZMcKGZVI8yfvEL4laTM8Hw+qh5poQwtpEbK" + + "Xo47AkxygxJasUnykER2+aSTZ6kWU2D4xiNtFA6lzqN+/oA+NaYfPS0amAvyVlHR" + + "n/8IuGkxb5RrlqVssQstFnxsJuv88qdGSEqlcKq2tLeg9hb8eCnl2OFzvXmgbVER" + + "0JaV+4Z02fVG1IlR3Xo1mSit7yIU6++3usRCjx2yfXpnGGJUW5pe6YETjNew3ax+" + + "FAZ4GePWCdmS7FvBnbbABKo5pE06ZTfDUTCjQlAJQiUgoF6ntMJvQAXPu48Vr8q/" + + "mTcuZWVnI6CDgyE7nNq3WNoq3397sBzxRohMxuqzl3T19zkfPKF05iV2Ju1HQMW5" + + "I119bYrmVD240aGESZc20Sx/9g1BFpNzQbM5PGUlWJ0dhLjl2ge4ip2hHciY3OEY" + + "p2Qy2k+xEdenpKdL+WMRimCQoO9gWe2Tp4NmP5dppDXZgPjXqjZpnGs0Uxs+fXqW" + + "cwlg3MbX3rFl9so/fhVf4p9oXZK3ve7z5D6XSSDRYECvsKIa08WAxJ/U6n204E/4" + + "xUF+3ZgFPdzZGn2PU7SsnOsCAwEAAQ=="; @EventHandler - public void initEvent(FMLInitializationEvent initializationEvent) - { + public void initEvent(final FMLInitializationEvent initializationEvent) { MinecraftForge.EVENT_BUS.register(this); - if (dgInterface != null) { - main = this; - try { - dgInterface.init(initializationEvent); - } catch (Exception e) { - cause = e; - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - PrintStream printStream = new PrintStream(byteArrayOutputStream); - e.printStackTrace(printStream); - stacktrace = new String(byteArrayOutputStream.toByteArray()); - - e.printStackTrace(); - } + try { + logger.info("init-ing DungeonsGuide"); + dgInstance.init(); + } catch (Exception e) { + handleException(e, null); } } + + + private boolean showedError = false; @SubscribeEvent(priority = EventPriority.HIGHEST) public void onGuiOpen(GuiOpenEvent guiOpenEvent) { if (!showedError && !isLoaded && guiOpenEvent.gui instanceof GuiMainMenu) { - guiOpenEvent.gui = new GuiLoadingError(cause, stacktrace, guiOpenEvent.gui); + guiOpenEvent.gui = new GuiLoadingError(guiOpenEvent.gui); showedError = true; } + } + + @Getter + static File configDir; + @EventHandler - public void preInit(FMLPreInitializationEvent preInitializationEvent) { - ProgressManager.ProgressBar progressBar = ProgressManager.push("DungeonsGuide", this.getClass().getResourceAsStream("/kr/syeyoung/dungeonsguide/e.class") == null ? 7 : 6); - Authenticator authenticator = new Authenticator(progressBar); - String token = null; + public void preInit(final FMLPreInitializationEvent preInitializationEvent) { + MinecraftForge.EVENT_BUS.register(new YoMamaOutdated()); + + ProgressManager.ProgressBar progressBar = null; + try { - token = authenticator.authenticateAndDownload(this.getClass().getResourceAsStream("/kr/syeyoung/dungeonsguide/DungeonsGuide.class") == null ? System.getProperty("dg.version") == null ? "nlatest" : System.getProperty("dg.version") : null); - if (token != null) { - main = this; - URL.setURLStreamHandlerFactory(new DGStreamHandlerFactory(authenticator)); - LaunchClassLoader classLoader = (LaunchClassLoader) Main.class.getClassLoader(); - classLoader.addURL(new URL("z:///")); - - try { - progressBar.step("Initializing"); - this.dgInterface = new DungeonsGuide(authenticator); - this.dgInterface.pre(preInitializationEvent); - while (progressBar.getStep() < progressBar.getSteps()) - progressBar.step("random-"+progressBar.getStep()); - ProgressManager.pop(progressBar); - isLoaded = true; - } catch (Throwable e) { - cause = e; - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - PrintStream printStream = new PrintStream(byteArrayOutputStream); - e.printStackTrace(printStream); - stacktrace = new String(byteArrayOutputStream.toByteArray()); - - while (progressBar.getStep() < progressBar.getSteps()) - progressBar.step("random-"+progressBar.getStep()); - ProgressManager.pop(progressBar); - - e.printStackTrace(); + try (InputStream premiumControlClass = this.getClass().getResourceAsStream("/kr/syeyoung/dungeonsguide/e.class")) { + progressBar = ProgressManager.push("DungeonsGuide", premiumControlClass == null ? 7 : 6); + } + + AuthManager.getInstance().setBaseserverurl(SERVER_URL); + AuthManager.getInstance().init(); + + + configDir = new File(preInitializationEvent.getModConfigurationDirectory(), "dungeonsguide"); + + + String version = null; + try (InputStream resourceAsStream = this.getClass().getResourceAsStream("/kr/syeyoung/dungeonsguide/DungeonsGuide.class")) { + if (resourceAsStream == null) { + if (System.getProperty("dg.version") == null) { + version = "nlatest"; + } else { + version = System.getProperty("dg.version"); + } } + }catch (Exception e){ + e.printStackTrace(); } - } catch (IOException | AuthenticationException | NoSuchAlgorithmException | CertificateException | KeyStoreException | KeyManagementException | InvalidKeySpecException | SignatureException e) { - cause = e; - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - PrintStream printStream = new PrintStream(byteArrayOutputStream); - e.printStackTrace(printStream); - stacktrace = new String(byteArrayOutputStream.toByteArray()); - - while (progressBar.getStep() < progressBar.getSteps()) - progressBar.step("random-"+progressBar.getStep()); - ProgressManager.pop(progressBar); - - e.printStackTrace(); + ResourceManager.getInstance().setBaseUrl(Main.SERVER_URL); + ResourceManager.getInstance().setBASE64_X509ENCODEDKEYSPEC(Main.SOME_FUNNY_KEY_THING); + + if(!AuthManager.getInstance().isPlebUser() && version != null){ + ResourceManager.getInstance().downloadAssets(version); + } + + URL.setURLStreamHandlerFactory(new DGStreamHandlerFactory()); + LaunchClassLoader classLoader = (LaunchClassLoader) Main.class.getClassLoader(); + classLoader.addURL(new URL("z:///")); + + progressBar.step("Initializing"); + + dgInstance = new DungeonsGuide(); + dgInstance.preinit(); + + finishUpProgressBar(progressBar); + isLoaded = true; + + } catch (IOException | InvalidDungeonsGuideCredentialsException e) { + handleException(e, progressBar); } } - public static Main a() { - return main; + + public void handleException(@NotNull final Throwable e, ProgressManager.ProgressBar progressBar) { + GuiLoadingError.cause = e; + + finishUpProgressBar(progressBar); + + e.printStackTrace(); + } + + public static void finishUpProgressBar(final ProgressManager.ProgressBar progressBar) { + if(progressBar == null) return; + while (progressBar.getStep() < progressBar.getSteps()) + progressBar.step("random-" + progressBar.getStep()); + ProgressManager.pop(progressBar); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/YoMamaOutdated.java b/src/main/java/kr/syeyoung/dungeonsguide/YoMamaOutdated.java new file mode 100644 index 00000000..ca9b34f4 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/YoMamaOutdated.java @@ -0,0 +1,110 @@ +package kr.syeyoung.dungeonsguide; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.*; +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class YoMamaOutdated { + + Logger logger = LogManager.getLogger("YoMamaOutdated"); + + public boolean isUsingOutdatedDg = true; + String outdatedMessage; + + public YoMamaOutdated() { + MinecraftForge.EVENT_BUS.register(this); + this.check(); + } + + void check() { + + isUsingOutdatedDg = false; + +// try (CloseableHttpClient httpclient = HttpClients.createDefault()) { +// HttpGet httpget = new HttpGet( "https://dungeonsguide.kingstefan26.workers.dev/outdated"); +// Header[] haeders = {new BasicHeader("User-Agent", "DungeonsGuide/" + Main.VERSION)}; +// httpget.setHeaders(haeders); +// HttpResponse httpresponse = httpclient.execute(httpget); +// +// if (httpresponse.getStatusLine().getStatusCode() != 200) { +// outdatedMessage = IOUtils.toString(httpresponse.getEntity().getContent(), StandardCharsets.UTF_8); +// }else { +// isUsingOutdatedDg = false; +// } +// +// } catch (Exception ignored) { +// } + + } + + private boolean showedError = false; + + @SubscribeEvent + public void onGuiOpen(GuiOpenEvent event) { + if (!showedError && isUsingOutdatedDg) { + showedError = true; + + GuiScreen ogGui = event.gui; + + event.gui = new GuiScreen() { + @Override + public void initGui() { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + this.buttonList.add(new GuiButton(0, sr.getScaledWidth()/2-100,sr.getScaledHeight()-70 ,"Close Minecraft")); + this.buttonList.add(new GuiButton(1, sr.getScaledWidth()/2-100,sr.getScaledHeight()-40 ,"Ignore")); + } + + @Override + protected void actionPerformed(GuiButton button) throws IOException { + super.actionPerformed(button); + if (button.id == 0) { + FMLCommonHandler.instance().exitJava(-1,true); + } else if (button.id == 1) { + Minecraft.getMinecraft().displayGuiScreen(ogGui); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawBackground(1); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + String text = "This DungeonsGuide installation seems to be invalid"; + fontRenderer.drawString(text, (sr.getScaledWidth()-fontRenderer.getStringWidth(text))/2,40,0xFFFF0000); + String text1 = "Message from our server:"; + fontRenderer.drawString(text1, (sr.getScaledWidth()-fontRenderer.getStringWidth(text1))/2, (int) (40+fontRenderer.FONT_HEIGHT*1.5),0xFFFF0000); + + int tenth = sr.getScaledWidth() / 10; + + Gui.drawRect(tenth, 70,sr.getScaledWidth()-tenth, sr.getScaledHeight()-80, 0xFF5B5B5B); + clip(sr, tenth, 70,sr.getScaledWidth()-2*tenth, sr.getScaledHeight()-150); + GL11.glEnable(GL11.GL_SCISSOR_TEST); + + + fontRenderer.drawString(outdatedMessage, tenth+2,fontRenderer.FONT_HEIGHT + 72, 0xFFFFFFFF); + + GL11.glDisable(GL11.GL_SCISSOR_TEST); + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void clip(ScaledResolution resolution, int x, int y, int width, int height) { + if (width < 0 || height < 0) return; + + int scale = resolution.getScaleFactor(); + GL11.glScissor((x ) * scale, Minecraft.getMinecraft().displayHeight - (y + height) * scale, (width) * scale, height * scale); + } + }; + } + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/AuthManager.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/AuthManager.java new file mode 100644 index 00000000..5588a4a2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/AuthManager.java @@ -0,0 +1,150 @@ +package kr.syeyoung.dungeonsguide.auth; + +import com.google.common.base.Throwables; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.google.gson.JsonObject; +import com.mojang.authlib.exceptions.AuthenticationException; +import kr.syeyoung.dungeonsguide.auth.authprovider.AuthProvider; +import kr.syeyoung.dungeonsguide.auth.authprovider.DgAuth.DgAuth; +import kr.syeyoung.dungeonsguide.auth.authprovider.DgAuth.DgAuthUtil; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.events.impl.AuthChangedEvent; +import kr.syeyoung.dungeonsguide.mod.stomp.StompManager; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.IOException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.util.Objects; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; + + +public class AuthManager { + Logger logger = LogManager.getLogger("AuthManger"); + + private static AuthManager instance; + + public static AuthManager getInstance() { + if(instance == null) instance = new AuthManager(); + return instance; + } + + + @Setter + private String baseserverurl = "https://dungeons.guide"; + + private AuthProvider currentProvider; + + public String getToken() { + if (currentProvider != null && currentProvider.getToken() != null) { + return currentProvider.getToken(); + } + return null; + } + + public KeyPair getKeyPair(){ + if (currentProvider != null && currentProvider.getToken() != null) { + return currentProvider.getRsaKey(); + } + return null; + } + + + boolean initlock = false; + + public void init() { + if (initlock) { + logger.info("Cannot init AuthManger twice"); + return; + } + + reauth(); + + initlock = true; + + + MinecraftForge.EVENT_BUS.register(this); + + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("DgAuth Pool").build(); + final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, namedThreadFactory); + scheduler.scheduleAtFixedRate(() -> { + if (getToken() != null) { + JsonObject obj = DgAuthUtil.getJwtPayload(getToken()); + if (!obj.get("uuid").getAsString().replace("-", "").equals(Minecraft.getMinecraft().getSession().getPlayerID())) { + shouldReAuth = true; + } + } + }, 10,2000, TimeUnit.MILLISECONDS); + } + + boolean shouldReAuth = true; + int tickCounter; + + @SubscribeEvent + public void onTickClientTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + if (tickCounter % 200 == 0) { + tickCounter = 0; + reauth(); + } + tickCounter++; + + } + + public boolean isPlebUser(){ + return Objects.equals(getInstance().getPlanType(), "OPENSOURCE"); + } + + public String getPlanType(){ + if(getToken() == null) return null; + + + JsonObject jwt = DgAuthUtil.getJwtPayload(getToken()); + + if(!jwt.has("plan")) return null; + + return jwt.get("plan").getAsString(); + + } + + void reauth() { + if (!shouldReAuth) return; + + shouldReAuth = false; + + currentProvider = null; + try { + currentProvider = new DgAuth(baseserverurl).createAuthProvider(); + if (currentProvider.getToken() == null) { + shouldReAuth = true; + currentProvider = null; + ChatTransmitter.addToQueue("§eDungeons Guide §7:: §r§cDG auth failed, trying again in ten seconds", true); + logger.info("DG auth failed, trying again in a second"); + } else { + // RE-AUTHed SUCCESSFULLY HOORAY + // for some reason the forge events don't work in pre init, so I call the callback directly + StompManager.getInstance().init(); + MinecraftForge.EVENT_BUS.post(new AuthChangedEvent()); + } + } catch (NoSuchAlgorithmException | AuthenticationException | IOException e) { + + shouldReAuth = true; + currentProvider = null; + ChatTransmitter.addToQueue("§eDungeons Guide §7:: §r§cDG auth failed, trying again in ten seconds", true); + logger.error("Re-auth failed with message {}, trying again in a ten seconds", String.valueOf(Throwables.getRootCause(e))); + } + + } + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/AuthUtil.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/AuthUtil.java new file mode 100644 index 00000000..d96b054d --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/AuthUtil.java @@ -0,0 +1,70 @@ +package kr.syeyoung.dungeonsguide.auth; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +import javax.crypto.*; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.HttpsURLConnection; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.security.*; + +public class AuthUtil { + private AuthUtil() {} + + public static KeyPair getKeyPair() throws NoSuchAlgorithmException { + KeyPairGenerator a = null; + a = KeyPairGenerator.getInstance("RSA"); + a.initialize(1024); + return a.generateKeyPair(); + } + + + public static JsonElement getJsonSecured(String u) throws IOException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException{ + + int length = 0; + CipherInputStream cipherInputStream = null; + + HttpsURLConnection httpsURLConnection = (HttpsURLConnection) new URL(u).openConnection(); + httpsURLConnection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); + httpsURLConnection.setRequestProperty("Content-Type", "application/json"); + httpsURLConnection.setRequestMethod("GET"); + httpsURLConnection.setRequestProperty("Authorization", AuthManager.getInstance().getToken()); + httpsURLConnection.setDoInput(true); + httpsURLConnection.setDoOutput(true); + + InputStream inputStream = httpsURLConnection.getInputStream(); + byte[] lengthPayload = new byte[4]; + inputStream.read(lengthPayload); + length = ((lengthPayload[0] & 0xFF) << 24) | + ((lengthPayload[1] & 0xFF) << 16) | + ((lengthPayload[2] & 0xFF) << 8) | + ((lengthPayload[3] & 0xFF)); + while (inputStream.available() < length) ; + byte[] keyPayload = new byte[length]; + inputStream.read(keyPayload); + + Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + cipher.init(Cipher.DECRYPT_MODE, AuthManager.getInstance().getKeyPair().getPrivate()); + byte[] AESKey = cipher.doFinal(keyPayload); + + cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + SecretKeySpec secretKeySpec = new SecretKeySpec(AESKey, "AES"); + IvParameterSpec ivParameterSpec = new IvParameterSpec(AESKey); + cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec); + cipherInputStream = new CipherInputStream(inputStream, cipher); + cipherInputStream.read(lengthPayload); + length = ((lengthPayload[0] & 0xFF) << 24) | + ((lengthPayload[1] & 0xFF) << 16) | + ((lengthPayload[2] & 0xFF) << 8) | + ((lengthPayload[3] & 0xFF)); + + httpsURLConnection.disconnect(); + + return new JsonParser().parse(new InputStreamReader(cipherInputStream)); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/InvalidDungeonsGuideCredentialsException.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/InvalidDungeonsGuideCredentialsException.java new file mode 100644 index 00000000..98caa049 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/InvalidDungeonsGuideCredentialsException.java @@ -0,0 +1,8 @@ +package kr.syeyoung.dungeonsguide.auth; + +public class InvalidDungeonsGuideCredentialsException extends Throwable { + + public InvalidDungeonsGuideCredentialsException(String message) { + super(message); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/ResourceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/ResourceManager.java new file mode 100644 index 00000000..56d46aea --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/ResourceManager.java @@ -0,0 +1,164 @@ +package kr.syeyoung.dungeonsguide.auth; + +import lombok.Setter; +import net.minecraftforge.common.MinecraftForge; +import org.apache.commons.codec.binary.Base64; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.crypto.*; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.HttpsURLConnection; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.security.*; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import java.util.HashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +public class ResourceManager { + + Logger logger = LogManager.getLogger("ResourceManager"); + + @Setter + private String baseUrl; + @Setter + private String BASE64_X509ENCODEDKEYSPEC; + private final HashMap<String, byte[]> loadedResources = new HashMap<>(); + + + private static ResourceManager instance; + public static ResourceManager getInstance() { + if(instance == null) { + instance = new ResourceManager(); + MinecraftForge.EVENT_BUS.register(instance); + } + return instance; + } + + private ResourceManager() { + } + + public Map<String, byte[]> getResources() { + return loadedResources; + } + + + public void downloadAssets(String version) throws InvalidDungeonsGuideCredentialsException { + if(AuthManager.getInstance().getToken() == null) throw new InvalidDungeonsGuideCredentialsException("Not Authenticated while downloading assets"); + try { + // version not being null indicates that the user is "premium" + // so we download the special version + if (version != null) + downloadSafe( baseUrl + "/resource/version?v=" + version, true); + + if(!AuthManager.getInstance().isPlebUser()){ + downloadSafe(baseUrl + "/resource/roomdata", false); + } else { + logger.error("The current User is a pleb not downloading user data"); + } + + } catch (Exception t) { + t.printStackTrace(); + } + + } + + private void downloadSafe(String url, boolean isValidateSignature) throws IOException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException, SignatureException, InvalidKeySpecException { + HttpsURLConnection dgConnection = (HttpsURLConnection) new URL(url).openConnection(); + dgConnection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); + dgConnection.setRequestProperty("Content-Type", "application/json"); + dgConnection.setRequestMethod("GET"); + dgConnection.setRequestProperty("Authorization", AuthManager.getInstance().getToken()); + dgConnection.setDoInput(true); + dgConnection.setDoOutput(true); + + InputStream inputStream = dgConnection.getInputStream(); + byte[] lengthBytes = new byte[4]; + inputStream.read(lengthBytes); + int length = ((lengthBytes[0] & 0xFF) << 24) | + ((lengthBytes[1] & 0xFF) << 16) | + ((lengthBytes[2] & 0xFF) << 8) | + ((lengthBytes[3] & 0xFF)); + while (inputStream.available() < length) ; + byte[] keyPayload = new byte[length]; + inputStream.read(keyPayload); + + Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + cipher.init(Cipher.DECRYPT_MODE, AuthManager.getInstance().getKeyPair().getPrivate()); + byte[] h = cipher.doFinal(keyPayload); + + cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + SecretKeySpec keySpec = new SecretKeySpec(h, "AES"); + IvParameterSpec ivSpec = new IvParameterSpec(h); + cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); + CipherInputStream cipherInputStream = new CipherInputStream(inputStream, cipher); + + cipherInputStream.read(lengthBytes); + length = ((lengthBytes[0] & 0xFF) << 24) | + ((lengthBytes[1] & 0xFF) << 16) | + ((lengthBytes[2] & 0xFF) << 8) | + ((lengthBytes[3] & 0xFF)); + + int totalLen = length; + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + byte[] buff = new byte[256]; + while (totalLen > 0) { + int len = cipherInputStream.read(buff, 0, Math.min(buff.length, totalLen)); + totalLen -= len; + bos.write(buff, 0, len); + } + byte[] body = bos.toByteArray(); + + byte[] signed; + if (isValidateSignature) { + cipherInputStream.read(lengthBytes,0 , 4); + length = ((lengthBytes[0] & 0xFF) << 24) | + ((lengthBytes[1] & 0xFF) << 16) | + ((lengthBytes[2] & 0xFF) << 8) | + ((lengthBytes[3] & 0xFF)); + + totalLen = length; + bos = new ByteArrayOutputStream(); + while (totalLen > 0) { + int len = cipherInputStream.read(buff, 0, Math.min(buff.length, totalLen)); + totalLen -= len; + bos.write(buff, 0, len); + } + signed = bos.toByteArray(); + + Signature sign = Signature.getInstance("SHA512withRSA"); + sign.initVerify(getPublicKey(BASE64_X509ENCODEDKEYSPEC)); + sign.update(body); + boolean truth = sign.verify(signed); + if (!truth) throw new SignatureException("DG SIGNATURE FORGED"); + } + + ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(body)); + ZipEntry zipEntry; + while ((zipEntry=zipInputStream.getNextEntry()) != null) { + byte[] buffer = new byte[256]; + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + int p; + while((p = zipInputStream.read(buffer)) > 0) { + byteArrayOutputStream.write(buffer, 0, p); + } + this.loadedResources.put(zipEntry.getName(), byteArrayOutputStream.toByteArray()); + } + } + + + public static PublicKey getPublicKey(String base64X509EncodedKeySpec) throws NoSuchAlgorithmException, InvalidKeySpecException { + X509EncodedKeySpec spec = new X509EncodedKeySpec(Base64.decodeBase64(base64X509EncodedKeySpec)); + + return KeyFactory.getInstance("RSA").generatePublic(spec); + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/AuthProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/AuthProvider.java new file mode 100644 index 00000000..ba42574e --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/AuthProvider.java @@ -0,0 +1,16 @@ +package kr.syeyoung.dungeonsguide.auth.authprovider; + +import com.mojang.authlib.exceptions.AuthenticationException; + +import java.io.IOException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; + +public interface AuthProvider { + String getToken(); + + KeyPair getRsaKey(); + + + AuthProvider createAuthProvider() throws NoSuchAlgorithmException, AuthenticationException, IOException; +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuth.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuth.java new file mode 100644 index 00000000..0e7a05f6 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuth.java @@ -0,0 +1,46 @@ +package kr.syeyoung.dungeonsguide.auth.authprovider.DgAuth; + +import com.mojang.authlib.exceptions.AuthenticationException; +import kr.syeyoung.dungeonsguide.auth.AuthUtil; +import kr.syeyoung.dungeonsguide.auth.authprovider.AuthProvider; + +import java.io.IOException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; + +public class DgAuth implements AuthProvider { + + private final String authServerUrl; + + public DgAuth(String authServerUrl){ + this.authServerUrl = authServerUrl; + } + + private String token; + private KeyPair rsaKey; + + @Override + public String getToken() { + return token; + } + + @Override + public KeyPair getRsaKey() { + return rsaKey; + } + + + @Override + public AuthProvider createAuthProvider() throws NoSuchAlgorithmException, AuthenticationException, IOException { + this.rsaKey = AuthUtil.getKeyPair(); + + String tempToken = DgAuthUtil.requestAuth(this.authServerUrl); + + DgAuthUtil.checkSessionAuthenticity(tempToken); + + this.token = DgAuthUtil.verifyAuth(tempToken, rsaKey.getPublic(), authServerUrl); + + return this; + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuthUtil.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuthUtil.java new file mode 100644 index 00000000..b01fba50 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/DgAuth/DgAuthUtil.java @@ -0,0 +1,88 @@ +package kr.syeyoung.dungeonsguide.auth.authprovider.DgAuth; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.IOUtils; + +import javax.net.ssl.HttpsURLConnection; +import java.io.IOException; +import java.math.BigInteger; +import java.net.URL; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PublicKey; + +public class DgAuthUtil { + private DgAuthUtil(){} + + public static String requestAuth(String baseurl) throws IOException { + GameProfile profile = Minecraft.getMinecraft().getSession().getProfile(); + + HttpsURLConnection connection = (HttpsURLConnection) new URL(baseurl + "/auth/requestAuth").openConnection(); + connection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); + connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestMethod("POST"); + connection.setDoInput(true); + connection.setDoOutput(true); + + connection.getOutputStream().write(("{\"uuid\":\""+profile.getId().toString()+"\",\"nickname\":\""+profile.getName()+"\"}").getBytes()); + String payload = String.join("\n", IOUtils.readLines(connection.getErrorStream() == null ? connection.getInputStream() : connection.getErrorStream())); + + JsonObject json = (JsonObject) new JsonParser().parse(payload); + + if (!"ok".equals(json.get("status").getAsString())) { + return null; + } + return json.get("data").getAsString(); + } + + public static void checkSessionAuthenticity(String tempToken) throws NoSuchAlgorithmException, AuthenticationException { + JsonObject d = getJwtPayload(tempToken); + byte[] sharedSecret = Base64.decodeBase64(d.get("sharedSecret").getAsString()); + byte[] publicKey =Base64.decodeBase64(d.get("publicKey").getAsString()); + String hash = calculateServerHash(sharedSecret, publicKey); + + Session session = Minecraft.getMinecraft().getSession(); + MinecraftSessionService yggdrasilMinecraftSessionService = Minecraft.getMinecraft().getSessionService(); + yggdrasilMinecraftSessionService.joinServer(session.getProfile(), session.getToken(), hash); + } + + public static String verifyAuth(String tempToken, PublicKey clientKey, String baseurl) throws IOException { + HttpsURLConnection urlConnection = (HttpsURLConnection) new URL(baseurl + "/auth/authenticate").openConnection(); + urlConnection.setRequestMethod("POST"); + urlConnection.setRequestProperty("User-Agent", "DungeonsGuide/1.0"); + urlConnection.setRequestProperty("Content-Type", "application/json"); + urlConnection.setDoInput(true); + urlConnection.setDoOutput(true); + + urlConnection.getOutputStream().write(("{\"jwt\":\""+tempToken+"\",\"publicKey\":\""+Base64.encodeBase64URLSafeString(clientKey.getEncoded())+"\"}").getBytes()); + String payload = String.join("\n", IOUtils.readLines(urlConnection.getErrorStream() == null ? urlConnection.getInputStream() : urlConnection.getErrorStream())); + + JsonObject jsonObject = (JsonObject) new JsonParser().parse(payload); + if (!"ok".equals(jsonObject.get("status").getAsString())) { + return null; + } + return jsonObject.get("data").getAsString(); + } + + public static JsonObject getJwtPayload(String jwt) { + String midPart = jwt.split("\\.")[1].replace("+", "-").replace("/", "_"); + String base64Decode = new String(Base64.decodeBase64(midPart)); // padding + return (JsonObject) new JsonParser().parse(base64Decode); + } + + public static String calculateServerHash(byte[] a, byte[] b) throws NoSuchAlgorithmException { + MessageDigest c = MessageDigest.getInstance("SHA-1"); + c.update("".getBytes()); + c.update(a); + c.update(b); + byte[] d = c.digest(); + return new BigInteger(d).toString(16); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/NullAuth.java b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/NullAuth.java new file mode 100644 index 00000000..ec7e9aed --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/auth/authprovider/NullAuth.java @@ -0,0 +1,62 @@ +package kr.syeyoung.dungeonsguide.auth.authprovider; + +import com.mojang.authlib.exceptions.AuthenticationException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.IOException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; + +public class NullAuth implements AuthProvider { + + Logger logger = LogManager.getLogger("NullAuth"); + + @Override + public String getToken() { + return "TOKEN"; + } + + @Override + public KeyPair getRsaKey() { + return new KeyPair(new PublicKey() { + @Override + public String getAlgorithm() { + return null; + } + + @Override + public String getFormat() { + return null; + } + + @Override + public byte[] getEncoded() { + return new byte[0]; + } + }, new PrivateKey() { + @Override + public String getAlgorithm() { + return null; + } + + @Override + public String getFormat() { + return null; + } + + @Override + public byte[] getEncoded() { + return new byte[0]; + } + }); + } + + @Override + public AuthProvider createAuthProvider() throws NoSuchAlgorithmException, AuthenticationException, IOException { + return new NullAuth(); + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java deleted file mode 100755 index 8f9ae312..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.dungeon; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; -import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProvider; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProviderRegistry; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.EDungeonDoorType; -import kr.syeyoung.dungeonsguide.dungeon.events.DungeonMapUpdateEvent; -import kr.syeyoung.dungeonsguide.dungeon.events.DungeonNodataEvent; -import kr.syeyoung.dungeonsguide.dungeon.events.DungeonRoomDiscoverEvent; -import kr.syeyoung.dungeonsguide.dungeon.events.SerializableBlockPos; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.DungeonContextInitializationEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.stomp.StompPayload; -import kr.syeyoung.dungeonsguide.utils.MapUtils; -import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; -import lombok.Getter; -import lombok.Setter; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemMap; -import net.minecraft.item.ItemStack; -import net.minecraft.util.*; -import net.minecraft.world.storage.MapData; -import net.minecraftforge.common.MinecraftForge; -import org.json.JSONObject; - -import javax.vecmath.Vector2d; -import java.awt.*; -import java.util.List; -import java.util.Queue; -import java.util.*; - -public class MapProcessor { - - private final DungeonContext context; - - private byte[] lastMapData; - - @Getter - private MapData lastMapData2; - - @Getter - private final BiMap<String, String> mapIconToPlayerMap = HashBiMap.create(); - - @Getter @Setter - private Dimension unitRoomDimension; - @Getter @Setter - private Dimension doorDimension; // width: width of door, height: gap between rooms - @Getter @Setter - private Point topLeftMapPoint; - - @Setter - private boolean bugged = false; - - private final List<Point> roomsFound = new ArrayList<Point>(); - - private boolean axisMatch = false; - - @Getter - private boolean initialized = false; - - @Getter - private int undiscoveredRoom = 0; - - public MapProcessor(DungeonContext context) { - this.context = context; - } - - private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0,1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1 , 0)); - - private int waitCnt = 0; - private void buildMap(final byte[] mapData) { - final Point startroom = MapUtils.findFirstColorWithIn(mapData, (byte) 30, new Rectangle(0,0,128,128)); - if (startroom == null){ - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't retrieve map data, disabling mod for this dungeon run")); - bugged = true; - return; - } - // Determine room dimension - { - int width = MapUtils.getWidthOfColorAt(mapData, (byte) 30, startroom); - int height = MapUtils.getHeightOfColorAt(mapData, (byte) 30, startroom); - unitRoomDimension = new Dimension(width, height); - } - Vector2d doorDir = null; - // determine the gap - { - Point midStartRoom = new Point(startroom.x + unitRoomDimension.width / 2, startroom.y +unitRoomDimension.height / 2); - final int halfWidth = unitRoomDimension.width / 2 + 2; - for (Vector2d v:directions) { - byte color = MapUtils.getMapColorAt(mapData, (int)(v.x * halfWidth +midStartRoom.x), (int)(v.y *halfWidth +midStartRoom.y)); - if (color != 0) { - doorDir = v; - break; - } - } - - if (doorDir == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't determine door of the room, disabling mod for this dungeon run")); - bugged = true; - return; - } - Point basePoint = new Point(startroom.x, startroom.y); - if (doorDir.x > 0) basePoint.x += unitRoomDimension.width; - if (doorDir.x < 0) basePoint.x += -1; - if (doorDir.y > 0) basePoint.y += unitRoomDimension.height; - if (doorDir.y < 0) basePoint.y += -1; - int gap = MapUtils.getLengthOfColorExtending(mapData, (byte) 0, basePoint, doorDir); - Point pt = MapUtils.findFirstColorWithInNegate(mapData, (byte)0, new Rectangle(basePoint.x, basePoint.y, (int)Math.abs(doorDir.y) * unitRoomDimension.width + 1, (int)Math.abs(doorDir.x) * unitRoomDimension.height + 1)); - if (pt == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't determine door of the room, disabling mod for this dungeon run")); - bugged = true; - return; - } - int doorWidth = MapUtils.getLengthOfColorExtending(mapData, MapUtils.getMapColorAt(mapData, pt.x, pt.y), pt, new Vector2d((int)Math.abs(doorDir.y), (int)Math.abs(doorDir.x))); - doorDimension = new Dimension(doorWidth, gap); - } - // Determine Top Left - { - int x = startroom.x; - int y = startroom.y; - while (x >= unitRoomDimension.width + doorDimension.height) x -= unitRoomDimension.width + doorDimension.height; - while (y >= unitRoomDimension.height + doorDimension.height) y -= unitRoomDimension.height + doorDimension.height; - topLeftMapPoint = new Point(x, y); - } - // determine door location based on npc, and determine map min from there - { - DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); - if (doorFinder == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't find door processor for "+ DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName())); - bugged = true; - return; - } - BlockPos door = doorFinder.findDoor(context.getWorld(), DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); - if (door == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't determine door of the room, disabling mod for this dungeon run")); - bugged = true; - return; - } - - DungeonsGuide.sendDebugChat(new ChatComponentText("door Pos:"+door)); - - Point unitPoint = mapPointToRoomPoint(startroom); - unitPoint.translate(unitPoint.x + 1, unitPoint.y + 1); - unitPoint.translate((int)doorDir.x, (int)doorDir.y); - - Vector2d offset = doorFinder.findDoorOffset(context.getWorld(), DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); - axisMatch = doorDir.equals(offset); - - int worldX = unitPoint.x * 16; - int worldY = unitPoint.y * 16; - BlockPos worldMin = door.add(-worldX, 0, -worldY); - context.setDungeonMin(worldMin); - - } - - DungeonsGuide.sendDebugChat(new ChatComponentText("Found Green room:"+startroom)); - DungeonsGuide.sendDebugChat(new ChatComponentText("Axis match:"+axisMatch)); - DungeonsGuide.sendDebugChat(new ChatComponentText("World Min:"+context.getDungeonMin())); - DungeonsGuide.sendDebugChat(new ChatComponentText("Dimension:"+unitRoomDimension)); - DungeonsGuide.sendDebugChat(new ChatComponentText("top Left:"+topLeftMapPoint)); - DungeonsGuide.sendDebugChat(new ChatComponentText("door dimension:"+doorDimension)); - context.createEvent(new DungeonNodataEvent("MAP_PROCESSOR_INIT")); - initialized = true; - MinecraftForge.EVENT_BUS.post(new DungeonContextInitializationEvent()); - } - - public Point mapPointToRoomPoint(Point mapPoint) { - int x = (int)((mapPoint.x - topLeftMapPoint.x) / ((double)unitRoomDimension.width + doorDimension.height)); - int y = (int)((mapPoint.y - topLeftMapPoint.y) / ((double)unitRoomDimension.height + doorDimension.height)); - return new Point(x,y); - } - public BlockPos mapPointToWorldPoint(Point mapPoint) { - int x = (int)((mapPoint.x - topLeftMapPoint.x) / ((double)unitRoomDimension.width + doorDimension.height) * 32 + context.getDungeonMin().getX()); - int y = (int)((mapPoint.y - topLeftMapPoint.y) / ((double)unitRoomDimension.height + doorDimension.height) * 32 + context.getDungeonMin().getZ()); - return new BlockPos(x,70,y); - } - public Point roomPointToMapPoint(Point roomPoint) { - return new Point(roomPoint.x * (unitRoomDimension.width +doorDimension.height) + topLeftMapPoint.x, - roomPoint.y *(unitRoomDimension.height + doorDimension.height) + topLeftMapPoint.y); - } - public BlockPos roomPointToWorldPoint(Point roomPoint) { - return new BlockPos(context.getDungeonMin().getX() +(roomPoint.x * 32), context.getDungeonMin().getY(), context.getDungeonMin().getZ() +(roomPoint.y *32)); - } - public Point worldPointToRoomPoint(BlockPos worldPoint) { - if (context.getDungeonMin() == null) return null; - return new Point((worldPoint.getX() - context.getDungeonMin().getX()) / 32, (worldPoint.getZ() - context.getDungeonMin().getZ()) / 32); - } - - public Vector2d worldPointToMapPointFLOAT(Vec3 worldPoint) { - if (context.getDungeonMin() == null) return null; - double x = topLeftMapPoint.x + ((worldPoint.xCoord - context.getDungeonMin().getX()) / 32.0f * (unitRoomDimension.width + doorDimension.height)); - double y = topLeftMapPoint.y + ((worldPoint.zCoord - context.getDungeonMin().getZ()) / 32.0f * (unitRoomDimension.height + doorDimension.height)); - return new Vector2d(x, y); - } - - public Point worldPointToMapPoint(Vec3 worldPoint) { - if (context.getDungeonMin() == null) return null; - return new Point(topLeftMapPoint.x + (int)((worldPoint.xCoord - context.getDungeonMin().getX()) / 32.0f * (unitRoomDimension.width + doorDimension.height)), topLeftMapPoint.y + (int)((worldPoint.zCoord - context.getDungeonMin().getZ()) / 32.0f * (unitRoomDimension.height + doorDimension.height))); - } - - private void processMap(byte[] mapData) { - int height = (int)((128.0 - topLeftMapPoint.y) / (unitRoomDimension.height + doorDimension.height)); - int width = (int) ((128.0 - topLeftMapPoint.x) / (unitRoomDimension.width + doorDimension.height)); - if (MapUtils.getMapColorAt(mapData,0,0) != 0) return; - undiscoveredRoom = 0; - for (int y = 0; y <= height; y++){ - for (int x = 0; x <= width; x++) { - Point mapPoint = roomPointToMapPoint(new Point(x,y)); - byte color = MapUtils.getMapColorAt(mapData, mapPoint.x, mapPoint.y); - MapUtils.record(mapData, mapPoint.x, mapPoint.y, new Color(255,255,0,80)); - if (roomsFound.contains(new Point(x,y))) { - DungeonRoom dungeonRoom = context.getRoomMapper().get(new Point(x,y)); - if (color == 18 && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FINISHED) { - dungeonRoom.setCurrentState(DungeonRoom.RoomState.COMPLETE_WITHOUT_SECRETS); - dungeonRoom.setTotalSecrets(0); - } else if (color == 30) { - dungeonRoom.setCurrentState(DungeonRoom.RoomState.FINISHED); - dungeonRoom.setTotalSecrets(0); - } else if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FINISHED){ - byte centerColor = MapUtils.getMapColorAt(mapData, mapPoint.x + unitRoomDimension.width / 2, mapPoint.y + unitRoomDimension.height / 2); - MapUtils.record(mapData, mapPoint.x + unitRoomDimension.width / 2, mapPoint.y + unitRoomDimension.height / 2, new Color(0,255,0,80)); - if (centerColor == 34) { - dungeonRoom.setCurrentState(DungeonRoom.RoomState.COMPLETE_WITHOUT_SECRETS); - } else if (centerColor == 30) { - dungeonRoom.setCurrentState(DungeonRoom.RoomState.FINISHED); - } else if (centerColor == 18) { // red - dungeonRoom.setCurrentState(DungeonRoom.RoomState.FAILED); - } - } - if (dungeonRoom.getTotalSecrets() == -1) { - if (dungeonRoom.getColor() == 82) dungeonRoom.setTotalSecrets(0); - else if (dungeonRoom.getColor() == 74) dungeonRoom.setTotalSecrets(0); - MapUtils.record(mapData, mapPoint.x, mapPoint.y +1, new Color(0,255,0,80)); - } - continue; - } - - if (color != 0 && color != 85) { - MapUtils.record(mapData, mapPoint.x, mapPoint.y, new Color(0,255,255,80)); - DungeonRoom rooms = buildRoom(mapData, new Point(x,y)); - if (rooms == null) continue; - context.createEvent(new DungeonRoomDiscoverEvent(rooms.getUnitPoints().get(0), rooms.getRoomMatcher().getRotation(), new SerializableBlockPos(rooms.getMin()), new SerializableBlockPos(rooms.getMax()), rooms.getShape(),rooms.getColor(), rooms.getDungeonRoomInfo().getUuid(), rooms.getDungeonRoomInfo().getName(), rooms.getDungeonRoomInfo().getProcessorId())); - DungeonsGuide.sendDebugChat(new ChatComponentText("New Map discovered! shape: "+rooms.getShape()+ " color: "+rooms.getColor()+" unitPos: "+x+","+y)); - DungeonsGuide.sendDebugChat(new ChatComponentText("New Map discovered! mapMin: "+rooms.getMin() + " mapMx: "+rooms.getMax())); - StringBuilder builder = new StringBuilder(); - for (int dy =0;dy<4;dy++) { - builder.append("\n"); - for (int dx = 0; dx < 4; dx ++) { - boolean isSet = ((rooms.getShape() >> (dy * 4 + dx)) & 0x1) != 0; - builder.append(isSet ? "O" : "X"); - } - } - DungeonsGuide.sendDebugChat(new ChatComponentText("Shape visual: "+ builder)); - - context.getDungeonRoomList().add(rooms); - for (Point p:rooms.getUnitPoints()) { - roomsFound.add(p); - context.getRoomMapper().put(p, rooms); - } - if (rooms.getRoomProcessor() != null && rooms.getRoomProcessor().readGlobalChat()) - context.getGlobalRoomProcessors().add(rooms.getRoomProcessor()); - } else if (color == 85){ - undiscoveredRoom++; - } - - } - } - } - - private static final Set<Vector2d> door_dirs = Sets.newHashSet(new Vector2d(0,0.5), new Vector2d(0, -0.5), new Vector2d(0.5, 0), new Vector2d(-0.5 , 0)); - private DungeonRoom buildRoom(byte[] mapData, Point unitPoint) { - Queue<Point[]> toCheck = new LinkedList<Point[]>(); - toCheck.add(new Point[] {unitPoint, unitPoint}); // requestor, target - Set<Point> checked = new HashSet<Point>(); - List<Point> ayConnected = new ArrayList<Point>(); - - int minX = Integer.MAX_VALUE, minY = Integer.MAX_VALUE; - int maxX = 0, maxY = 0; - while(toCheck.peek() != null) { - Point[] check = toCheck.poll(); - if (checked.contains(check[1])) continue; - checked.add(check[1]); - - if (checkIfConnected(mapData, check[0], check[1])) { - ayConnected.add(check[1]); - if (check[1].x < minX) minX = check[1].x; - if (check[1].y < minY) minY = check[1].y; - if (check[1].x > maxX) maxX = check[1].x; - if (check[1].y > maxY) maxY = check[1].y; - for (Vector2d dir: directions) { - Point newPt = new Point(check[1].x + (int)dir.x, check[1].y +(int)dir.y); - toCheck.add(new Point[]{check[1], newPt}); - } - } - } - - short shape = 0; - for (Point p:ayConnected) { - int localX = p.x - minX, localY = p.y - minY; - shape |= 1 <<(localY *4 + localX); - } - Set<Vector2d> doors = new HashSet<>(); - for (Point p: ayConnected) { - for (Vector2d v: door_dirs) { - Vector2d v2 = new Vector2d(p.x + v.x , p.y + v.y ); - if (doors.contains(v2)) doors.remove(v2); - else doors.add(v2); - } - } - Point pt2 = roomPointToMapPoint(ayConnected.get(0)); - byte unit1 = MapUtils.getMapColorAt(mapData, pt2.x, pt2.y); - - // 0: none 1: open door door 2. unopen door 3: wither door 4. red door - Set<Tuple<Vector2d, EDungeonDoorType>> doorsAndStates = new HashSet<>(); - final int halfWidth = unitRoomDimension.width + 4; - for (Vector2d door : doors) { - int floorX = (int)Math.floor(door.x), floorY = (int)Math.floor(door.y); - Point mapPt = roomPointToMapPoint(new Point(floorX, floorY)); - Point target = new Point(mapPt.x+ unitRoomDimension.width/2 + (int)(halfWidth*(door.x - floorX)), mapPt.y + unitRoomDimension.height/2 + (int)(halfWidth*(door.y - floorY)) ); - MapUtils.record(mapData, target.x, target.y, Color.green); - byte color = MapUtils.getMapColorAt(mapData, target.x, target.y); - - Vector2d vector2d = new Vector2d(door.x - minX, door.y - minY); - if (color == 0) { - doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.NONE)); - } else if (color == 85) { - doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.UNOPEN)); - } else if (color == 119) { - doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.WITHER)); - } else if (color == 18 && unit1 != 18) { - doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.BLOOD)); - } else { - doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.ENTRANCE)); - } - } - - - try{ - return new DungeonRoom(ayConnected, shape, unit1, roomPointToWorldPoint(new Point(minX, minY)), roomPointToWorldPoint(new Point(maxX+1, maxY+1)).add(-1, 0, -1), context, doorsAndStates); - } catch (IllegalStateException ex) { - DungeonsGuide.sendDebugChat(new ChatComponentText("Failed to load room, retrying later :: "+ex.getLocalizedMessage())); - return null; - } - } - - private boolean checkIfConnected(byte[] mapData, Point unitPoint1, Point unitPoint2) { - if (unitPoint1 == unitPoint2) return true; - if (unitPoint1.equals(unitPoint2)) return true; - - - Point high = (unitPoint2.y > unitPoint1.y) ? unitPoint2 :(unitPoint2.x > unitPoint1.x) ? unitPoint2 : unitPoint1; - Point low = high == unitPoint2 ? unitPoint1 : unitPoint2; - - int xOff = low.x - high.x; - int yOff = low.y - high.y; - Point pt = roomPointToMapPoint(high); - Point pt2 = roomPointToMapPoint(low); - byte unit1 = MapUtils.getMapColorAt(mapData, pt.x, pt.y); - byte unit2 = MapUtils.getMapColorAt(mapData, pt2.x, pt2.y); - pt.translate(xOff, yOff); - byte unit3 = MapUtils.getMapColorAt(mapData, pt.x, pt.y); - - return unit1 == unit2 && unit2 == unit3 && unit1 != 0; - } - - public boolean isThereDifference(byte[] colors1, byte[] colors) { - if (colors1 == null || colors == null) return true; - for (int i =0; i < colors.length; i++) - if (colors[i] != colors1[i]) return true; - return false; - } - private int stabilizationTick = 0; - - private boolean processed = false; - private void processFinishedMap(byte[] mapData) { - if (MapUtils.getMapColorAt(mapData, 0, 0) == 0) return; - if (processed) return; - processed = true; - MapUtils.clearMap(); - MapUtils.record(mapData, 0, 0, Color.GREEN); - - int skill = MapUtils.readNumber(mapData, 51, 35, 9); - int exp = MapUtils.readNumber(mapData, 51, 54, 9); - int time = MapUtils.readNumber(mapData, 51, 73, 9); - int bonus = MapUtils.readNumber(mapData, 51, 92, 9); - DungeonsGuide.sendDebugChat(new ChatComponentText(("skill: " + skill + " / exp: " + exp + " / time: " + time + " / bonus : " + bonus))); - JSONObject payload = new JSONObject().put("timeSB", FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed()) - .put("timeR", FeatureRegistry.DUNGEON_REALTIME.getTimeElapsed()) - .put("timeScore", time) - .put("completionStage", context.getBossRoomEnterSeconds() == -1 ? 0 : - context.isDefeated() ? 2 : 1) - .put("percentage", DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getPercentage() / 100.0) - .put("floor", DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); - DungeonsGuide.sendDebugChat(new ChatComponentText(payload.toString())); - - try { - String target = StaticResourceCache.INSTANCE.getResource(StaticResourceCache.DATA_COLLECTION).get().getValue(); - if (FeatureRegistry.ETC_COLLECT_SCORE.isEnabled() && !target.contains("falsefalsefalsefalse")) { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(payload.toString()).header("destination", target.replace("false", "").trim())); - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - public void tick() { - if (waitCnt < 5) { - waitCnt++; - return; - } - if (bugged) return; - ItemStack stack = Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(8); - byte[] mapData; - if (stack == null || !(stack.getItem() instanceof ItemMap)) { - mapData = lastMapData; - } else { - MapData mapData1 = ((ItemMap)stack.getItem()).getMapData(stack, context.getWorld()); - if (mapData1 == null) mapData = lastMapData; - else { - mapData = mapData1.colors; - lastMapData2 = mapData1; - - if (isThereDifference(lastMapData, mapData)) { - stabilizationTick =0; - context.createEvent(new DungeonMapUpdateEvent(mapData)); - } else { - stabilizationTick++; - } - - if (stabilizationTick > 20) { - if (doorDimension == null) buildMap(mapData); - else processMap(mapData); - - if (context.isEnded()) { - processFinishedMap(mapData); - } - } - lastMapData = mapData; - } - - } - - - if (lastMapData2 != null && mapIconToPlayerMap.size() < context.getPlayers().size() && initialized) { - label: for (Map.Entry<String, Vec4b> stringVec4bEntry : lastMapData2.mapDecorations.entrySet()) { - if (mapIconToPlayerMap.containsValue(stringVec4bEntry.getKey())) continue; - int x = stringVec4bEntry.getValue().func_176112_b() /2 + 64; - int y = stringVec4bEntry.getValue().func_176113_c() /2 + 64; - BlockPos mapPos = mapPointToWorldPoint(new Point(x, y)); - String potentialPlayer = null; - for (String player : context.getPlayers()) { // check nearby players - if (mapIconToPlayerMap.containsKey(player)) continue; - EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(player); - if (entityPlayer == null || entityPlayer.isInvisible()) continue; - BlockPos pos = entityPlayer.getPosition(); - int dx = mapPos.getX() - pos.getX(); - int dz = mapPos.getZ() - pos.getZ(); - if (dx * dx + dz * dz < 100) { - if (potentialPlayer != null) continue label; - potentialPlayer = player; - } - } - if (potentialPlayer == null) continue; - - for (Map.Entry<String, Vec4b> stringVec4bEntry2 : lastMapData2.mapDecorations.entrySet()) { // check nearby markers - if (mapIconToPlayerMap.containsValue(stringVec4bEntry.getKey())) continue; - if (stringVec4bEntry.getKey().equals(stringVec4bEntry2.getKey())) continue; - int x2 = stringVec4bEntry2.getValue().func_176112_b() /2 + 64; - int y2 = stringVec4bEntry2.getValue().func_176113_c() /2 + 64; - int dx = x2 - x; - int dy = y2 - y; - if (dx * dx + dy * dy < 100) { - continue label; - } - } - mapIconToPlayerMap.put(potentialPlayer, stringVec4bEntry.getKey()); - } - } - - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/Action.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/Action.java deleted file mode 100755 index 1a4ad682..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/Action.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.dungeon.actions; - -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; - -import java.util.Set; - -public interface Action { - Set<Action> getPreRequisites(DungeonRoom dungeonRoom); - - void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRoute.ActionRouteProperties actionRouteProperties); - void onLivingInteract(DungeonRoom dungeonRoom, PlayerInteractEntityEvent event, ActionRoute.ActionRouteProperties actionRouteProperties); - void onLivingDeath(DungeonRoom dungeonRoom, LivingDeathEvent event, ActionRoute.ActionRouteProperties actionRouteProperties); - void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag); - void onRenderScreen(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties); - void onTick(DungeonRoom dungeonRoom, ActionRoute.ActionRouteProperties actionRouteProperties); - - boolean isComplete(DungeonRoom dungeonRoom); -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/DungeonRoomInfo.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/DungeonRoomInfo.java index 0df1f15a..8c430e4c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/DungeonRoomInfo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/DungeonRoomInfo.java @@ -18,7 +18,7 @@ package kr.syeyoung.dungeonsguide.dungeon.data; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; import lombok.Getter; import lombok.Setter; @@ -53,8 +53,8 @@ public class DungeonRoomInfo implements Serializable { private String processorId = "default"; - private Map<String, Object> properties = new HashMap<String, Object>(); + private Map<String, Object> properties = new HashMap<>(); - private Map<String, DungeonMechanic> mechanics = new HashMap<String, DungeonMechanic>(); + private Map<String, DungeonMechanic> mechanics = new HashMap<>(); private int totalSecrets = -1; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java index 36317878..f5baa2ca 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java @@ -18,8 +18,8 @@ package kr.syeyoung.dungeonsguide.dungeon.data; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.VectorUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.VectorUtils; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; @@ -63,25 +63,23 @@ public class OffsetPoint implements Cloneable, Serializable { } public BlockPos toRotatedRelBlockPos(DungeonRoom dungeonRoom) { - int rot = dungeonRoom.getRoomMatcher().getRotation(); - Vector2d rot2 = new Vector2d(x,z); + Vector2d rot = new Vector2d(x,z); for (int i = 0; i < dungeonRoom.getRoomMatcher().getRotation(); i++) { - rot2 = VectorUtils.rotateCounterClockwise(rot2); + rot = VectorUtils.rotateCounterClockwise(rot); if (i % 2 == 0) { - rot2.y += dungeonRoom.getMax().getZ() - dungeonRoom.getMin().getZ() + 1; // + Z + rot.y += dungeonRoom.getMax().getZ() - dungeonRoom.getMin().getZ() + 1; // + Z } else { - rot2.y += dungeonRoom.getMax().getX() - dungeonRoom.getMin().getX() + 1; // + X + rot.y += dungeonRoom.getMax().getX() - dungeonRoom.getMin().getX() + 1; // + X } } - return new BlockPos(rot2.x, y, rot2.y); + return new BlockPos(rot.x, y, rot.y); } public Block getBlock(DungeonRoom dungeonRoom) { BlockPos relBp = toRotatedRelBlockPos(dungeonRoom); - Block b = dungeonRoom.getRelativeBlockAt(relBp.getX(), relBp.getY(), relBp.getZ()); - return b; + return dungeonRoom.getRelativeBlockAt(relBp.getX(), relBp.getY(), relBp.getZ()); } public BlockPos getBlockPos(DungeonRoom dungeonRoom) { BlockPos relBp = toRotatedRelBlockPos(dungeonRoom); @@ -91,8 +89,7 @@ public class OffsetPoint implements Cloneable, Serializable { public int getData(DungeonRoom dungeonRoom) { BlockPos relBp = toRotatedRelBlockPos(dungeonRoom); - int b = dungeonRoom.getRelativeBlockDataAt(relBp.getX(), relBp.getY(), relBp.getZ()); - return b; + return dungeonRoom.getRelativeBlockDataAt(relBp.getX(), relBp.getY(), relBp.getZ()); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPointSet.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPointSet.java index 6e8e5ee7..0fc21dc2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPointSet.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPointSet.java @@ -26,7 +26,7 @@ import java.util.List; @Data public class OffsetPointSet implements Cloneable, Serializable { - private List<OffsetPoint> offsetPointList = new ArrayList<OffsetPoint>(); + private List<OffsetPoint> offsetPointList = new ArrayList<>(); @Override public Object clone() throws CloneNotSupportedException { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java deleted file mode 100755 index ef7f076e..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.dungeon.doorfinder; - -import com.google.common.base.Predicate; -import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.*; -import net.minecraft.entity.item.EntityArmorStand; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.world.World; - -import javax.vecmath.Vector2d; -import java.util.Collection; -import java.util.Set; - -public class CatacombDataProvider implements DungeonSpecificDataProvider { - - private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0,1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1 , 0)); - - @Override - public BlockPos findDoor(World w, String dungeonName) { - Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { - @Override - public boolean apply(EntityArmorStand input) { - return input.getName().equals("§bMort"); - } - }); - - if (armorStand.size() != 0) { - EntityArmorStand mort = armorStand.iterator().next(); - BlockPos pos = mort.getPosition(); - pos = pos.add(0, 3, 0); - for (int i = 0; i < 5; i++) { - for (Vector2d vector2d:directions) { - BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); - if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { - return pos.add(vector2d.x * (i + 2), -2, vector2d.y * (i+2)); - } - } - } - } - return null; - } - - @Override - public Vector2d findDoorOffset(World w, String dungeonName) { - Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { - @Override - public boolean apply(EntityArmorStand input) { - return input.getName().equals("§bMort"); - } - }); - - if (armorStand.size() != 0) { - EntityArmorStand mort = armorStand.iterator().next(); - BlockPos pos = mort.getPosition(); - pos = pos.add(0, 3, 0); - for (int i = 0; i < 5; i++) { - for (Vector2d vector2d:directions) { - BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); - if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { - return vector2d; - } - } - } - } - return null; - } - /* - * - * */ - - @Override - public BossfightProcessor createBossfightProcessor(World w, String dungeonName) { - String floor = dungeonName.substring(14).trim(); - DungeonsGuide.sendDebugChat(new ChatComponentText("Floor: "+floor+ " Building bossfight processor")); - if (floor.equals("F1")) { - return new BossfightProcessorBonzo(); - } else if (floor.equals("F2")) { - return new BossfightProcessorScarf(); - } else if (floor.equals("F3")) { - return new BossfightProcessorProf(); - } else if (floor.equals("F4")) { - return new BossfightProcessorThorn(); - } else if (floor.equals("F5")) { - return new BossfightProcessorLivid(false); - } else if (floor.equals("F6")) { - return new BossfightProcessorSadan(); - } else if (floor.equals("F7")) { - return new BossfightProcessorNecron(); - } - return null; - } - - @Override - public boolean isTrapSpawn(String dungeonName) { - String floor = dungeonName.substring(14).trim(); - if (floor.equals("F3")) { - return true; - } else if (floor.equals("F4")) { - return true; - } else if (floor.equals("F5")) { - return true; - } else if (floor.equals("F6")) { - return true; - } else return floor.equals("F7"); - } - - @Override - public double secretPercentage(String dungeonName) { - String floor = dungeonName.substring(14).trim(); - if (floor.equals("F1")) { - return 0.3; - } else if (floor.equals("F2")) { - return 0.4; - } else if (floor.equals("F3")) { - return 0.5; - } else if (floor.equals("F4")) { - return 0.6; - } else if (floor.equals("F5")) { - return 0.7; - } else if (floor.equals("F6")) { - return 0.85; - } else if (floor.equals("F7")) { - return 1.0; - } else if (floor.equals("E")) { - return 0.3; - } - return 1.0; - } - - @Override - public int speedSecond(String dungeonName) { - String floor = dungeonName.substring(14).trim(); - if (floor.equals("F1")) { - return 600; - } else if (floor.equals("F2")) { - return 600; - } else if (floor.equals("F3")) { - return 600; - } else if (floor.equals("F4")) { - return 600; - } else if (floor.equals("F5")) { - return 720; - } else if (floor.equals("F6")) { - return 600; - } else if (floor.equals("F7")) { - return 720; - } - return 600; - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java deleted file mode 100755 index 921efa63..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.dungeon.doorfinder; - -import com.google.common.base.Predicate; -import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.*; -import net.minecraft.entity.item.EntityArmorStand; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.world.World; - -import javax.vecmath.Vector2d; -import java.util.Collection; -import java.util.Set; - -public class CatacombMasterDataProvider implements DungeonSpecificDataProvider { - - private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0,1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1 , 0)); - - @Override - public BlockPos findDoor(World w, String dungeonName) { - Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { - @Override - public boolean apply(EntityArmorStand input) { - return input.getName().equals("§bMort"); - } - }); - - if (armorStand.size() != 0) { - EntityArmorStand mort = armorStand.iterator().next(); - BlockPos pos = mort.getPosition(); - pos = pos.add(0, 3, 0); - for (int i = 0; i < 5; i++) { - for (Vector2d vector2d:directions) { - BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); - if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { - return pos.add(vector2d.x * (i + 2), -2, vector2d.y * (i+2)); - } - } - } - } - return null; - } - - @Override - public Vector2d findDoorOffset(World w, String dungeonName) { - Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { - @Override - public boolean apply(EntityArmorStand input) { - return input.getName().equals("§bMort"); - } - }); - - if (armorStand.size() != 0) { - EntityArmorStand mort = armorStand.iterator().next(); - BlockPos pos = mort.getPosition(); - pos = pos.add(0, 3, 0); - for (int i = 0; i < 5; i++) { - for (Vector2d vector2d:directions) { - BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); - if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { - return vector2d; - } - } - } - } - return null; - } - /* - * - * */ - - @Override - public BossfightProcessor createBossfightProcessor(World w, String dungeonName) { - String floor = dungeonName.substring(14).trim(); - DungeonsGuide.sendDebugChat(new ChatComponentText("Floor: Master mode "+floor+ " Building bossfight processor")); - if (floor.equals("M5")) { - return new BossfightProcessorLivid(true); - } - return null; - } - - @Override - public boolean isTrapSpawn(String dungeonName) { - String floor = dungeonName.substring(14).trim(); - if (floor.equals("M3")) { - return true; - } else if (floor.equals("M4")) { - return true; - } else if (floor.equals("M5")) { - return true; - } else if (floor.equals("M6")) { - return true; - } else return floor.equals("M7"); - } - - @Override - public double secretPercentage(String dungeonName) { - return 1.0; - } - - @Override - public int speedSecond(String dungeonName) { - return 480; - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java index dc201fdb..64d4dc0b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -19,11 +19,13 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.RouteBlocker; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -41,10 +43,10 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); int leastY = Integer.MAX_VALUE; OffsetPoint thatPt = null; @@ -69,8 +71,8 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { if (!isBlocking(dungeonRoom)) { return Collections.emptySet(); } - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); { ActionBreakWithSuperBoom actionClick; preRequisites.add(actionClick = new ActionBreakWithSuperBoom(getRepresentingPoint(dungeonRoom))); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java index e31cc78e..fc5abe45 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java @@ -19,12 +19,14 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.RouteBlocker; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; @@ -42,11 +44,11 @@ public class DungeonDoor implements DungeonMechanic, RouteBlocker { @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (!("open".equalsIgnoreCase(state) || "closed".equalsIgnoreCase(state))) throw new IllegalArgumentException(state+" is not valid state for door"); if (state.equalsIgnoreCase(getCurrentState(dungeonRoom))) return Collections.emptySet(); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); { if (state.equalsIgnoreCase("open")) { for (String str : openPreRequisite) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java index 876764be..60ca1b3a 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java @@ -19,10 +19,11 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.util.BlockPos; @@ -40,10 +41,10 @@ public class DungeonDummy implements DungeonMechanic { @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { // if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); if (state.equalsIgnoreCase("navigate")){ ActionMove actionMove = new ActionMove(secretPoint); preRequisites.add(actionMove); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java index c5270a9c..0bbecfbd 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java @@ -19,17 +19,25 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionInteract; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMove; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import java.awt.*; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; -import java.util.*; +import java.util.Set; +import java.util.function.Predicate; @Data public class DungeonFairySoul implements DungeonMechanic { @@ -39,27 +47,25 @@ public class DungeonFairySoul implements DungeonMechanic { @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { - if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); - { - ActionInteract actionClick= new ActionInteract(secretPoint); - actionClick.setPredicate(PredicateArmorStand.INSTANCE); - actionClick.setRadius(3); - preRequisites.add(actionClick); - preRequisites = actionClick.getPreRequisite(); - } - { - ActionMove actionMove = new ActionMove(secretPoint); - preRequisites.add(actionMove); - preRequisites = actionMove.getPreRequisite(); - } - { - for (String str : preRequisite) { - if (str.isEmpty()) continue; - ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); - preRequisites.add(actionChangeState); + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { + if (!"navigate".equalsIgnoreCase(state)) + throw new IllegalArgumentException(state + " is not valid state for secret"); + + Set<AbstractAction> base = new HashSet<>(); + ActionInteract actionClick = new ActionInteract(secretPoint); + actionClick.setPredicate((Predicate<Entity>) PredicateArmorStand.INSTANCE); + actionClick.setRadius(3); + base.add(actionClick); + + base = actionClick.getPreRequisite(); + ActionMove actionMove = new ActionMove(secretPoint); + base.add(actionMove); + base = actionMove.getPreRequisite(); + + for (String str : preRequisite) { + if (!str.isEmpty()) { + String[] split = str.split(":"); + base.add(new ActionChangeState(split[0], split[1])); } } return base; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java index 8796bccb..1edf51ef 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java @@ -19,12 +19,13 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMove; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.util.BlockPos; @@ -42,10 +43,10 @@ public class DungeonJournal implements DungeonMechanic { @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); { ActionMove actionMove = new ActionMove(secretPoint); preRequisites.add(actionMove); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java index 6d50ae78..637c9c2d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java @@ -19,10 +19,11 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.util.BlockPos; @@ -37,11 +38,11 @@ public class DungeonLever implements DungeonMechanic { private String triggering = ""; @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equals(getCurrentState(dungeonRoom))) return Collections.emptySet(); if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); @@ -54,8 +55,8 @@ public class DungeonLever implements DungeonMechanic { } if (!("triggered".equalsIgnoreCase(state) || "untriggered".equalsIgnoreCase(state))) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); if (!state.equalsIgnoreCase(getCurrentState(dungeonRoom))){ ActionClick actionClick; preRequisites.add(actionClick = new ActionClick(leverPoint)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java index 6007421f..9785cb62 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java @@ -19,15 +19,17 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionInteract; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionInteract; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMove; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import java.awt.*; @@ -35,36 +37,35 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.function.Predicate; @Data public class DungeonNPC implements DungeonMechanic { private static final long serialVersionUID = -89487601113028763L; - private OffsetPoint secretPoint = new OffsetPoint(0,0,0); + private OffsetPoint secretPoint = new OffsetPoint(0, 0, 0); private List<String> preRequisite = new ArrayList<String>(); @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { - if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); - { - ActionInteract actionClick= new ActionInteract(secretPoint); - actionClick.setPredicate(PredicateArmorStand.INSTANCE); - actionClick.setRadius(3); - preRequisites.add(actionClick); - preRequisites = actionClick.getPreRequisite(); - } - { - ActionMove actionMove = new ActionMove(secretPoint); - preRequisites.add(actionMove); - preRequisites = actionMove.getPreRequisite(); - } - { - for (String str : preRequisite) { - if (str.isEmpty()) continue; - ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); - preRequisites.add(actionChangeState); + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { + if (!"navigate".equalsIgnoreCase(state)) + throw new IllegalArgumentException(state + " is not valid state for secret"); + + Set<AbstractAction> base = new HashSet<>(); + ActionInteract actionClick = new ActionInteract(secretPoint); + actionClick.setPredicate((Predicate<Entity>) PredicateArmorStand.INSTANCE); + actionClick.setRadius(3); + base.add(actionClick); + + base = actionClick.getPreRequisite(); + ActionMove actionMove = new ActionMove(secretPoint); + base.add(actionMove); + base = actionMove.getPreRequisite(); + + for (String str : preRequisite) { + if (!str.isEmpty()) { + String[] split = str.split(":"); + base.add(new ActionChangeState(split[0], split[1])); } } return base; @@ -73,9 +74,9 @@ public class DungeonNPC implements DungeonMechanic { @Override public void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks) { BlockPos pos = getSecretPoint().getBlockPos(dungeonRoom); - RenderUtils.highlightBlock(pos, color,partialTicks); - RenderUtils.drawTextAtWorld("F-"+name, pos.getX() +0.5f, pos.getY()+0.375f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); - RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.highlightBlock(pos, color, partialTicks); + RenderUtils.drawTextAtWorld("F-" + name, pos.getX() + 0.5f, pos.getY() + 0.375f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() + 0.5f, pos.getY() + 0f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); } @@ -96,10 +97,12 @@ public class DungeonNPC implements DungeonMechanic { public Set<String> getPossibleStates(DungeonRoom dungeonRoom) { return Sets.newHashSet("navigate"); } + @Override public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { - return Sets.newHashSet("no-state","navigate"); + return Sets.newHashSet("no-state", "navigate"); } + @Override public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java index 92634c00..84201a60 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java @@ -19,13 +19,15 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMoveNearestAir; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMoveNearestAir; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.RouteBlocker; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; @@ -42,10 +44,10 @@ public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker { @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); @@ -60,8 +62,8 @@ public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker { if (!isBlocking(dungeonRoom)) { return Collections.emptySet(); } - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); { for (String str : preRequisite) { if (str.isEmpty()) continue; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java index 00c876c5..d0212380 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java @@ -19,10 +19,11 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.util.BlockPos; @@ -38,11 +39,11 @@ public class DungeonOnewayLever implements DungeonMechanic { private String triggering = ""; @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equals(getCurrentState(dungeonRoom))) return Collections.emptySet(); if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); @@ -54,8 +55,8 @@ public class DungeonOnewayLever implements DungeonMechanic { return base; } if (!("triggered".equalsIgnoreCase(state))) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); { ActionClick actionClick; preRequisites.add(actionClick = new ActionClick(leverPoint)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java index 1542513d..1f45e91d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java @@ -19,10 +19,11 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.util.BlockPos; @@ -33,16 +34,16 @@ import java.util.List; @Data public class DungeonPressurePlate implements DungeonMechanic { private static final long serialVersionUID = 7450034718355390645L; - private OffsetPoint platePoint = new OffsetPoint(0,0,0); + private OffsetPoint platePoint = new OffsetPoint(0, 0, 0); private List<String> preRequisite = new ArrayList<String>(); private String triggering = ""; @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equals(getCurrentState(dungeonRoom))) return Collections.emptySet(); if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); @@ -53,37 +54,35 @@ public class DungeonPressurePlate implements DungeonMechanic { } return base; } - if (!("triggered".equalsIgnoreCase(state) || "untriggered".equalsIgnoreCase(state))) throw new IllegalArgumentException(state+" is not valid state for secret"); + if (!("triggered".equalsIgnoreCase(state) || "untriggered".equalsIgnoreCase(state))) + throw new IllegalArgumentException(state + " is not valid state for secret"); if (state.equalsIgnoreCase(getCurrentState(dungeonRoom))) return Collections.emptySet(); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); if ("triggered".equalsIgnoreCase(state)) { ActionDropItem actionClick; preRequisites.add(actionClick = new ActionDropItem(platePoint)); preRequisites = actionClick.getPreRequisite(); } - { - ActionMove actionMove = new ActionMove(platePoint); - preRequisites.add(actionMove); - preRequisites = actionMove.getPreRequisite(); - } - { - for (String str : preRequisite) { - if (str.isEmpty()) continue; - ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); - preRequisites.add(actionChangeState); - } + ActionMove actionMove = new ActionMove(platePoint); + preRequisites.add(actionMove); + preRequisites = actionMove.getPreRequisite(); + for (String str : preRequisite) { + if (str.isEmpty()) continue; + ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); + preRequisites.add(actionChangeState); } + return base; } @Override public void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks) { BlockPos pos = getPlatePoint().getBlockPos(dungeonRoom); - RenderUtils.highlightBlock(pos, color,partialTicks); - RenderUtils.drawTextAtWorld(name, pos.getX() +0.5f, pos.getY()+0.75f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); - RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0.25f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.highlightBlock(pos, color, partialTicks); + RenderUtils.drawTextAtWorld(name, pos.getX() + 0.5f, pos.getY() + 0.75f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() + 0.5f, pos.getY() + 0.25f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); } public DungeonPressurePlate clone() throws CloneNotSupportedException { @@ -99,8 +98,7 @@ public class DungeonPressurePlate implements DungeonMechanic { public String getCurrentState(DungeonRoom dungeonRoom) { if (triggering == null) triggering = "null"; DungeonMechanic mechanic = dungeonRoom.getMechanics().get(triggering); - if (mechanic == null) - { + if (mechanic == null) { return "undeterminable"; } else { String state = mechanic.getCurrentState(dungeonRoom); @@ -121,10 +119,12 @@ public class DungeonPressurePlate implements DungeonMechanic { return Sets.newHashSet("navigate", "triggered"); return Sets.newHashSet("navigate"); } + @Override public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { return Sets.newHashSet("triggered", "untriggered"); } + @Override public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return platePoint; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java index 5ff85a13..259f438e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java @@ -19,14 +19,14 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMove; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; -import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import java.awt.*; @@ -41,15 +41,15 @@ public class DungeonRoomDoor implements DungeonMechanic { public DungeonRoomDoor(DungeonRoom dungeonRoom, DungeonDoor doorfinder) { this.doorfinder = doorfinder; if (doorfinder.isZDir()) { - if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(0,0,2))) - offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(0,0,2)); - else if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(0,0,-2))) - offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(0,0,-2)); + if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(0, 0, 2))) + offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(0, 0, 2)); + else if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(0, 0, -2))) + offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(0, 0, -2)); } else { - if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(2,0,0))) - offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(2,0,0)); - else if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(-2,0,0))) - offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(-2,0,0)); + if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(2, 0, 0))) + offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(2, 0, 0)); + else if (dungeonRoom.canAccessAbsolute(doorfinder.getPosition().add(-2, 0, 0))) + offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition().add(-2, 0, 0)); } if (offsetPoint == null) { offsetPoint = new OffsetPoint(dungeonRoom, doorfinder.getPosition()); @@ -57,24 +57,20 @@ public class DungeonRoomDoor implements DungeonMechanic { } @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { - if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); - { - ActionMove actionMove = new ActionMove(offsetPoint); - preRequisites.add(actionMove); - preRequisites = actionMove.getPreRequisite(); - } - return base; + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { + if (!"navigate".equalsIgnoreCase(state)) + throw new IllegalArgumentException(state + " is not valid state for secret"); + Set<AbstractAction> preRequisites = new HashSet<>(); + preRequisites.add(new ActionMove(offsetPoint)); + return preRequisites; } @Override public void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks) { BlockPos pos = offsetPoint.getBlockPos(dungeonRoom); - RenderUtils.highlightBlock(pos, color,partialTicks); - RenderUtils.drawTextAtWorld(name, pos.getX() +0.5f, pos.getY()+0.75f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); - RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0.25f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.highlightBlock(pos, color, partialTicks); + RenderUtils.drawTextAtWorld(name, pos.getX() + 0.5f, pos.getY() + 0.75f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() + 0.5f, pos.getY() + 0.25f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java index 5914be15..d806b7c5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java @@ -19,52 +19,56 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.DungeonActionManager; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonActionContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateBat; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.pathfinding.NodeProcessorDungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding.NodeProcessorDungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; +import net.minecraft.entity.passive.EntityBat; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import java.awt.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; @Data public class DungeonSecret implements DungeonMechanic { private static final long serialVersionUID = 8784808599222706537L; - private OffsetPoint secretPoint = new OffsetPoint(0,0,0); + private OffsetPoint secretPoint = new OffsetPoint(0, 0, 0); private SecretType secretType = SecretType.CHEST; private List<String> preRequisite = new ArrayList<String>(); public void tick(DungeonRoom dungeonRoom) { if (secretType == SecretType.CHEST) { BlockPos pos = secretPoint.getBlockPos(dungeonRoom); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(pos); + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos); if (blockState.getBlock() == Blocks.chest || blockState.getBlock() == Blocks.trapped_chest) { TileEntityChest chest = (TileEntityChest) dungeonRoom.getContext().getWorld().getTileEntity(pos); if (chest.numPlayersUsing > 0) { - dungeonRoom.getRoomContext().put("c-"+pos.toString(), 2); + dungeonRoom.getRoomContext().put("c-" + pos.toString(), 2); } else { - dungeonRoom.getRoomContext().put("c-"+pos.toString(), 1); + dungeonRoom.getRoomContext().put("c-" + pos.toString(), 1); } } } else if (secretType == SecretType.ESSENCE) { BlockPos pos = secretPoint.getBlockPos(dungeonRoom); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(pos); + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos); if (blockState.getBlock() == Blocks.skull) { - dungeonRoom.getRoomContext().put("e-"+pos.toString(), true); + dungeonRoom.getRoomContext().put("e-" + pos.toString(), true); } } else if (secretType == SecretType.ITEM_DROP) { Vec3 pos = new Vec3(secretPoint.getBlockPos(dungeonRoom)); @@ -74,7 +78,7 @@ public class DungeonSecret implements DungeonMechanic { for (int i = 0; i < player.distanceTo(pos); i++) { Vec3 vec = player.addVector(vec3.xCoord * i, vec3.yCoord * i, vec3.zCoord * i); BlockPos bpos = new BlockPos(vec); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(bpos); + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(bpos); if (!NodeProcessorDungeonRoom.isValidBlock(blockState)) return; } @@ -86,9 +90,9 @@ public class DungeonSecret implements DungeonMechanic { public SecretStatus getSecretStatus(DungeonRoom dungeonRoom) { if (secretType == SecretType.CHEST) { BlockPos pos = secretPoint.getBlockPos(dungeonRoom); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(pos); - if (dungeonRoom.getRoomContext().containsKey("c-"+pos.toString())) - return ((int)dungeonRoom.getRoomContext().get("c-"+pos.toString()) == 2 || blockState.getBlock() == Blocks.air) ? SecretStatus.FOUND : SecretStatus.CREATED; + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos); + if (dungeonRoom.getRoomContext().containsKey("c-" + pos.toString())) + return ((int) dungeonRoom.getRoomContext().get("c-" + pos.toString()) == 2 || blockState.getBlock() == Blocks.air) ? SecretStatus.FOUND : SecretStatus.CREATED; if (blockState.getBlock() == Blocks.air) { return SecretStatus.DEFINITELY_NOT; @@ -98,33 +102,33 @@ public class DungeonSecret implements DungeonMechanic { TileEntityChest chest = (TileEntityChest) dungeonRoom.getContext().getWorld().getTileEntity(pos); if (chest.numPlayersUsing > 0) { return SecretStatus.FOUND; - } else{ + } else { return SecretStatus.CREATED; } } } else if (secretType == SecretType.ESSENCE) { BlockPos pos = secretPoint.getBlockPos(dungeonRoom); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(pos); + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos); if (blockState.getBlock() == Blocks.skull) { - dungeonRoom.getRoomContext().put("e-"+pos.toString(), true); + dungeonRoom.getRoomContext().put("e-" + pos.toString(), true); return SecretStatus.DEFINITELY_NOT; } else { - if (dungeonRoom.getRoomContext().containsKey("e-"+pos.toString())) + if (dungeonRoom.getRoomContext().containsKey("e-" + pos.toString())) return SecretStatus.FOUND; return SecretStatus.NOT_SURE; } } else if (secretType == SecretType.BAT) { Vec3 spawn = new Vec3(secretPoint.getBlockPos(dungeonRoom)); - for (Integer killed : DungeonActionManager.getKilleds()) { - if (DungeonActionManager.getSpawnLocation().get(killed) == null) continue; - if (DungeonActionManager.getSpawnLocation().get(killed).squareDistanceTo(spawn) < 100) { + for (Integer killed : DungeonActionContext.getKilleds()) { + if (DungeonActionContext.getSpawnLocation().get(killed) == null) continue; + if (DungeonActionContext.getSpawnLocation().get(killed).squareDistanceTo(spawn) < 100) { return SecretStatus.FOUND; } } return SecretStatus.NOT_SURE; } else { Vec3 pos = new Vec3(secretPoint.getBlockPos(dungeonRoom)); - if (dungeonRoom.getRoomContext().containsKey("i-"+ pos)) + if (dungeonRoom.getRoomContext().containsKey("i-" + pos)) return SecretStatus.FOUND; Vec3 player = Minecraft.getMinecraft().thePlayer.getPositionVector(); if (player.squareDistanceTo(pos) < 16) { @@ -132,7 +136,7 @@ public class DungeonSecret implements DungeonMechanic { for (int i = 0; i < player.distanceTo(pos); i++) { Vec3 vec = player.addVector(vec3.xCoord * i, vec3.yCoord * i, vec3.zCoord * i); BlockPos bpos = new BlockPos(vec); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(bpos); + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(bpos); if (!NodeProcessorDungeonRoom.isValidBlock(blockState)) return SecretStatus.NOT_SURE; } @@ -143,10 +147,10 @@ public class DungeonSecret implements DungeonMechanic { } @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); @@ -157,43 +161,43 @@ public class DungeonSecret implements DungeonMechanic { } return base; } - if (!"found".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); + if (!"found".equalsIgnoreCase(state)) + throw new IllegalArgumentException(state + " is not valid state for secret"); if (state.equals("found") && getSecretStatus(dungeonRoom) == SecretStatus.FOUND) return new HashSet<>(); - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<AbstractAction>(); if (secretType == SecretType.CHEST || secretType == SecretType.ESSENCE) { ActionClick actionClick; preRequisites.add(actionClick = new ActionClick(secretPoint)); preRequisites = actionClick.getPreRequisite(); } else if (secretType == SecretType.BAT) { - ActionKill actionKill; - preRequisites.add(actionKill = new ActionKill(secretPoint)); - actionKill.setPredicate(PredicateBat.INSTANCE); + ActionKill actionKill = new ActionKill(secretPoint); + preRequisites.add(actionKill); + actionKill.setPredicate(EntityBat.class::isInstance); actionKill.setRadius(10); preRequisites = actionKill.getPreRequisite(); } - { - ActionMove actionMove = new ActionMove(secretPoint); - preRequisites.add(actionMove); - preRequisites = actionMove.getPreRequisite(); - } - { - for (String str : preRequisite) { - if (str.isEmpty()) continue; - ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); - preRequisites.add(actionChangeState); - } + + ActionMove actionMove = new ActionMove(secretPoint); + preRequisites.add(actionMove); + preRequisites = actionMove.getPreRequisite(); + + for (String str : preRequisite) { + if (str.isEmpty()) continue; + ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); + preRequisites.add(actionChangeState); } + return base; } @Override public void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks) { BlockPos pos = getSecretPoint().getBlockPos(dungeonRoom); - RenderUtils.highlightBlock(pos, color,partialTicks); - RenderUtils.drawTextAtWorld(getSecretType().name(), pos.getX() +0.5f, pos.getY()+0.75f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); - RenderUtils.drawTextAtWorld(name, pos.getX() +0.5f, pos.getY()+0.375f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); - RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.highlightBlock(pos, color, partialTicks); + RenderUtils.drawTextAtWorld(getSecretType().name(), pos.getX() + 0.5f, pos.getY() + 0.75f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(name, pos.getX() + 0.5f, pos.getY() + 0.375f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() + 0.5f, pos.getY() + 0f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); } public enum SecretType { @@ -228,10 +232,12 @@ public class DungeonSecret implements DungeonMechanic { if (status == SecretStatus.FOUND) return Sets.newHashSet("navigate"); else return Sets.newHashSet("found", "navigate"); } + @Override public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { return Sets.newHashSet("found"/*, "definitely_not", "not_sure", "created", "error"*/); } + @Override public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java index 24bc0d84..b14ffaf3 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java @@ -19,11 +19,13 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.RouteBlocker; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -37,14 +39,14 @@ import java.util.List; public class DungeonTomb implements DungeonMechanic, RouteBlocker { private static final long serialVersionUID = -7347076019472222115L; private OffsetPointSet secretPoint = new OffsetPointSet(); - private List<String> preRequisite = new ArrayList<String>(); + private List<String> preRequisite = new ArrayList<>(); @Override - public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + public Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom) { if (state.equalsIgnoreCase("navigate")) { - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<>(); ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); @@ -55,29 +57,28 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { } return base; } - if (!"open".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for tomb"); + if (!"open".equalsIgnoreCase(state)) { + throw new IllegalArgumentException(state + " is not valid state for tomb"); + } if (!isBlocking(dungeonRoom)) { return Collections.emptySet(); } - Set<Action> base; - Set<Action> preRequisites = base = new HashSet<Action>(); - { - ActionBreakWithSuperBoom actionClick; - preRequisites.add(actionClick = new ActionBreakWithSuperBoom(secretPoint.getOffsetPointList().get(0))); - preRequisites = actionClick.getPreRequisite(); - } - { - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(secretPoint.getOffsetPointList().get(0)); - preRequisites.add(actionMove); - preRequisites = actionMove.getPreRequisite(); - } - { - for (String str : preRequisite) { - if (str.isEmpty()) continue; - ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); - preRequisites.add(actionChangeState); - } + Set<AbstractAction> base; + Set<AbstractAction> preRequisites = base = new HashSet<>(); + + ActionBreakWithSuperBoom actionClick = new ActionBreakWithSuperBoom(secretPoint.getOffsetPointList().get(0)); + preRequisites.add(actionClick); + preRequisites = actionClick.getPreRequisite(); + + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(secretPoint.getOffsetPointList().get(0)); + preRequisites.add(actionMove); + preRequisites = actionMove.getPreRequisite(); + for (String str : preRequisite) { + if (str.isEmpty()) continue; + ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); + preRequisites.add(actionChangeState); } + return base; } @@ -86,11 +87,11 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { if (secretPoint.getOffsetPointList().isEmpty()) return; OffsetPoint firstpt = secretPoint.getOffsetPointList().get(0); BlockPos pos = firstpt.getBlockPos(dungeonRoom); - RenderUtils.drawTextAtWorld(name, pos.getX() +0.5f, pos.getY()+0.75f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); - RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0.25f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(name, pos.getX() + 0.5f, pos.getY() + 0.75f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() + 0.5f, pos.getY() + 0.25f, pos.getZ() + 0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { - RenderUtils.highlightBlock(offsetPoint.getBlockPos(dungeonRoom), color,partialTicks); + RenderUtils.highlightBlock(offsetPoint.getBlockPos(dungeonRoom), color, partialTicks); } } @@ -105,7 +106,7 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { public DungeonTomb clone() throws CloneNotSupportedException { DungeonTomb dungeonSecret = new DungeonTomb(); dungeonSecret.secretPoint = (OffsetPointSet) secretPoint.clone(); - dungeonSecret.preRequisite = new ArrayList<String>(preRequisite); + dungeonSecret.preRequisite = new ArrayList<>(preRequisite); return dungeonSecret; } @@ -114,13 +115,14 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { Block b = Blocks.air; if (!secretPoint.getOffsetPointList().isEmpty()) b = secretPoint.getOffsetPointList().get(0).getBlock(dungeonRoom); - return b == Blocks.air ?"open" :"closed"; + return b == Blocks.air ? "open" : "closed"; } @Override public Set<String> getPossibleStates(DungeonRoom dungeonRoom) { return isBlocking(dungeonRoom) ? Sets.newHashSet("open", "navigate") : Sets.newHashSet("navigate"); } + @Override public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { return Sets.newHashSet("open", "closed"); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/dunegonmechanic/DungeonMechanic.java index 54cac356..9aa18701 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/dunegonmechanic/DungeonMechanic.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.mechanics; +package kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import java.awt.*; import java.io.Serializable; import java.util.Set; public interface DungeonMechanic extends Serializable { - Set<Action> getAction(String state, DungeonRoom dungeonRoom); + Set<AbstractAction> getAction(String state, DungeonRoom dungeonRoom); void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/RouteBlocker.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/dunegonmechanic/RouteBlocker.java index 391bda2e..faad723a 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/RouteBlocker.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/dunegonmechanic/RouteBlocker.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.mechanics; +package kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; public interface RouteBlocker { boolean isBlocking(DungeonRoom dungeonRoom); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/predicates/PredicateArmorStand.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/predicates/PredicateArmorStand.java index 79b20725..8da45b89 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/predicates/PredicateArmorStand.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/predicates/PredicateArmorStand.java @@ -21,7 +21,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates; import com.google.common.base.Predicate; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityArmorStand; -import net.minecraft.entity.passive.EntityBat; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java deleted file mode 100755 index 7997aec4..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.eventlistener; - -import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.DungeonActionManager; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.*; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonParameterEdit; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; -import kr.syeyoung.dungeonsguide.utils.MapUtils; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import lombok.Getter; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiErrorScreen; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.passive.EntityBat; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.Vec3; -import net.minecraftforge.client.event.ClientChatReceivedEvent; -import net.minecraftforge.client.event.GuiScreenEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.client.CustomModLoadingErrorDisplayException; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.eventhandler.EventPriority; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.InputEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.relauncher.Side; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; - -import java.awt.*; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class DungeonListener { - @SubscribeEvent - public void onWorldLoad(WorldEvent.Unload event) { - try { - Config.saveConfig(); - } catch (IOException e) { - e.printStackTrace(); - } - DungeonActionManager.getSpawnLocation().clear(); - DungeonActionManager.getKilleds().clear(); - } - - @SubscribeEvent - public void onPostDraw(GuiScreenEvent.DrawScreenEvent.Post e) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - - if (!skyblockStatus.isOnDungeon()) return; - - if (skyblockStatus.getContext() != null) { - DungeonContext context = skyblockStatus.getContext(); - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - if (thePlayer == null) return; - if (context.getBossfightProcessor() != null) context.getBossfightProcessor().onPostGuiRender(e); - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null && dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onPostGuiRender(e); - } - } - GlStateManager.enableBlend(); - GlStateManager.color(1,1,1,1); - GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.enableAlpha(); - } catch (Throwable e2) {e2.printStackTrace(); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDG HAS RAN INTO ERROR WHILE RENDERING SCREEN! Please report to support channel"));} - } - @SubscribeEvent - public void onEntityUpdate(LivingEvent.LivingUpdateEvent e) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - - if (!skyblockStatus.isOnDungeon()) return; - - if (skyblockStatus.getContext() != null) { - DungeonContext context = skyblockStatus.getContext(); - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - if (thePlayer == null) return; - if (context.getBossfightProcessor() != null) context.getBossfightProcessor().onEntityUpdate(e); - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null && dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onEntityUpdate(e); - } - } - } catch (Throwable e2) {e2.printStackTrace();} - } - - boolean wasOnHypixel = false; - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent ev) throws Throwable { - try { - if (ev.side == Side.SERVER) return; - if (ev.phase == TickEvent.Phase.START) { - - - - - - - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - { - boolean isOnDungeon = skyblockStatus.isOnDungeon(); - boolean isOnSkyblock = skyblockStatus.isOnSkyblock(); - skyblockStatus.updateStatus(); - - if (!wasOnHypixel && skyblockStatus.isOnHypixel()) { - MinecraftForge.EVENT_BUS.post(new HypixelJoinedEvent()); - } - wasOnHypixel = skyblockStatus.isOnHypixel(); - - if (isOnSkyblock && !skyblockStatus.isOnSkyblock()) { - MinecraftForge.EVENT_BUS.post(new SkyblockLeftEvent()); - } else if (!isOnSkyblock && skyblockStatus.isOnSkyblock()) { - MinecraftForge.EVENT_BUS.post(new SkyblockJoinedEvent()); - } - - if ((isOnDungeon && !skyblockStatus.isOnDungeon())) { - MinecraftForge.EVENT_BUS.post(new DungeonLeftEvent()); - skyblockStatus.setContext(null); - if (!FeatureRegistry.ADVANCED_DEBUGGABLE_MAP.isEnabled()) - MapUtils.clearMap(); - return; - } - if (isOnSkyblock) { - if (skyblockStatus.getContext() != null) { - skyblockStatus.getContext().tick(); - } else if (skyblockStatus.isOnDungeon()){ - skyblockStatus.setContext(new DungeonContext(Minecraft.getMinecraft().thePlayer.worldObj)); - MinecraftForge.EVENT_BUS.post(new DungeonStartedEvent()); - } - } - } - - if (!skyblockStatus.isOnDungeon()) return; - - if (skyblockStatus.getContext() != null) { - DungeonContext context = skyblockStatus.getContext(); - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - if (thePlayer == null) return; - if (context.getBossfightProcessor() != null) context.getBossfightProcessor().tick(); - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null && dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().tick(); - } - } - } - } catch (Throwable e2) { - if (e2 instanceof CustomModLoadingErrorDisplayException) throw e2; - e2.printStackTrace(); - } - } - - - @SubscribeEvent - public void onHypixelJoin(HypixelJoinedEvent skyblockJoinedEvent) { - if (DungeonsGuide.getDungeonsGuide().isFirstTimeUsingDG()) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fThank you for installing DungeonsGuide, the most intelligent skyblock dungeon mod!")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fThe gui for relocating GUI Elements and enabling or disabling features can be opened by typing §e/dg")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fType §e/dg help §fto view full list of commands offered by dungeons guide!")); - } - } - - @SubscribeEvent - public void onRender(RenderGameOverlayEvent.Post postRender) { - try { - if (!(postRender.type == RenderGameOverlayEvent.ElementType.EXPERIENCE || postRender.type == RenderGameOverlayEvent.ElementType.JUMPBAR)) return; - - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - if (skyblockStatus.getContext() != null) { - DungeonContext context = skyblockStatus.getContext(); - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - if (context.getBossfightProcessor() != null) context.getBossfightProcessor().drawScreen(postRender.partialTicks); - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().drawScreen(postRender.partialTicks); - } - } - - } - GlStateManager.enableBlend(); - GlStateManager.color(1,1,1,1); - GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - Minecraft.getMinecraft().entityRenderer.setupOverlayRendering(); - GlStateManager.enableAlpha(); - } catch (Throwable e) { - e.printStackTrace();Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDG HAS RAN INTO ERROR WHILE RENDERING SCREEN! Please report to support channel")); - } - } - - @SubscribeEvent(receiveCanceled = true, priority = EventPriority.HIGHEST) - public void onChatReceived(ClientChatReceivedEvent clientChatReceivedEvent) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - if (clientChatReceivedEvent.type != 2 && clientChatReceivedEvent.message.getFormattedText().contains("§6> §e§lEXTRA STATS §6<")) { - MinecraftForge.EVENT_BUS.post(new DungeonEndedEvent()); - } - - DungeonContext context = skyblockStatus.getContext(); - - if (skyblockStatus.getContext() != null) { - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - try { - context.onChat(clientChatReceivedEvent); - } catch (Throwable t) { - t.printStackTrace(); - } - - if (context.getBossfightProcessor() != null) { - if (clientChatReceivedEvent.type == 2) - context.getBossfightProcessor().actionbarReceived(clientChatReceivedEvent.message); - else - context.getBossfightProcessor().chatReceived(clientChatReceivedEvent.message); - } - RoomProcessor roomProcessor = null; - try { - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - if (clientChatReceivedEvent.type == 2) { - dungeonRoom.getRoomProcessor().actionbarReceived(clientChatReceivedEvent.message); - roomProcessor = dungeonRoom.getRoomProcessor(); - } else { - dungeonRoom.getRoomProcessor().chatReceived(clientChatReceivedEvent.message); - roomProcessor = dungeonRoom.getRoomProcessor(); - } - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - if (clientChatReceivedEvent.type == 2) return; - for (RoomProcessor globalRoomProcessor : context.getGlobalRoomProcessors()) { - if (globalRoomProcessor == roomProcessor) continue; - try { - globalRoomProcessor.chatReceived(clientChatReceivedEvent.message); - } catch (Throwable t) { - t.printStackTrace(); - } - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - - @SubscribeEvent - public void onWorldRender(RenderWorldLastEvent renderWorldLastEvent) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - DungeonContext context = skyblockStatus.getContext(); - if (context == null) return; - if (FeatureRegistry.DEBUG.isEnabled()) { - for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { - for(DungeonDoor door : dungeonRoom.getDoors()) { - RenderUtils.renderDoor(door, renderWorldLastEvent.partialTicks); - } - } - } - - - if (skyblockStatus.getContext() != null) { - - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().drawWorld(renderWorldLastEvent.partialTicks); - } - - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().drawWorld(renderWorldLastEvent.partialTicks); - } - } - - if (FeatureRegistry.DEBUG.isEnabled() && dungeonRoom !=null) { - - Vec3 player = Minecraft.getMinecraft().thePlayer.getPositionVector(); - BlockPos real = new BlockPos(player.xCoord * 2, player.yCoord * 2, player.zCoord * 2); - for (BlockPos allInBox : BlockPos.getAllInBox(real.add(-1, -1, -1), real.add(1, 1, 1))) { - boolean blocked = dungeonRoom.isBlocked(allInBox.getX(), allInBox.getY(), allInBox.getZ()); - - RenderUtils.highlightBox( - AxisAlignedBB.fromBounds( - allInBox.getX() / 2.0 - 0.1, allInBox.getY() / 2.0 - 0.1, allInBox.getZ() / 2.0 - 0.1, - allInBox.getX() / 2.0 + 0.1, allInBox.getY() / 2.0 + 0.1, allInBox.getZ() / 2.0 + 0.1 - ), blocked ? new Color(0x55FF0000, true) : new Color(0x3300FF00, true), renderWorldLastEvent.partialTicks, false); - - } - } - - } - - if (EditingContext.getEditingContext() != null) { - GuiScreen guiScreen = EditingContext.getEditingContext().getCurrent(); - if (guiScreen instanceof GuiDungeonParameterEdit) { - ValueEdit valueEdit = ((GuiDungeonParameterEdit) guiScreen).getValueEdit(); - if (valueEdit != null) { - valueEdit.renderWorld(renderWorldLastEvent.partialTicks); - } - } else if (guiScreen instanceof GuiDungeonValueEdit) { - ValueEdit valueEdit = ((GuiDungeonValueEdit) guiScreen).getValueEdit(); - if (valueEdit != null) { - valueEdit.renderWorld(renderWorldLastEvent.partialTicks); - } - } else if (guiScreen instanceof GuiDungeonAddSet) { - ((GuiDungeonAddSet) guiScreen).onWorldRender(renderWorldLastEvent.partialTicks); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - @SubscribeEvent() - public void onKey2(KeyBindPressedEvent keyInputEvent) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - DungeonContext context = skyblockStatus.getContext(); - - if (skyblockStatus.getContext() != null) { - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().onKeybindPress(keyInputEvent); - } - RoomProcessor roomProcessor = null; - try { - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onKeybindPress(keyInputEvent); - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - @SubscribeEvent() - public void onInteract(PlayerInteractEntityEvent interact) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - DungeonContext context = skyblockStatus.getContext(); - - if (skyblockStatus.getContext() != null) { - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().onInteract(interact); - } - RoomProcessor roomProcessor = null; - try { - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onInteract(interact); - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - @SubscribeEvent() - public void onBlockChange(BlockUpdateEvent.Post postInteract) { - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - DungeonContext context = skyblockStatus.getContext(); - - if (skyblockStatus.getContext() != null) { - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().onBlockUpdate(postInteract); - } - RoomProcessor roomProcessor = null; - try { - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onBlockUpdate(postInteract); - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - @SubscribeEvent - public void onKeyInput(KeyBindPressedEvent keyInputEvent) { - if (FeatureRegistry.DEBUG.isEnabled() && FeatureRegistry.ADVANCED_ROOMEDIT.isEnabled() && keyInputEvent.getKey() == FeatureRegistry.ADVANCED_ROOMEDIT.<Integer>getParameter("key").getValue() ){ - EditingContext ec = EditingContext.getEditingContext(); - if (ec == null) { - DungeonContext context = DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext(); - if (context == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Not in dungeons")); - return; - } - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - - if (dungeonRoom == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Can't determine the dungeon room you're in")); - return; - } - - if (EditingContext.getEditingContext() != null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("There is an editing session currently open.")); - return; - } - - EditingContext.createEditingContext(dungeonRoom); - EditingContext.getEditingContext().openGui(new GuiDungeonRoomEdit(dungeonRoom)); - } else ec.reopen(); - } - } - @SubscribeEvent - public void onInteract(PlayerInteractEvent keyInputEvent) { - try { - if (!keyInputEvent.world.isRemote) return; - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - DungeonContext context = skyblockStatus.getContext(); - - if (skyblockStatus.getContext() != null) { - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().onInteractBlock(keyInputEvent); - } - RoomProcessor roomProcessor = null; - try { - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onInteractBlock(keyInputEvent); - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - @Getter - private final Map<Integer, Vec3> entityIdToPosMap = new HashMap<Integer, Vec3>(); - @SubscribeEvent - public void onEntitySpawn(EntityJoinWorldEvent spawn) { - DungeonActionManager.getSpawnLocation().put(spawn.entity.getEntityId(), new Vec3(spawn.entity.posX, spawn.entity.posY, spawn.entity.posZ)); - } - - - @SubscribeEvent - public void onEntityDeSpawn(LivingDeathEvent deathEvent) { - if (deathEvent.entityLiving instanceof EntityBat) - DungeonActionManager.getKilleds().add(deathEvent.entity.getEntityId()); - - try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; - - DungeonContext context = skyblockStatus.getContext(); - - if (skyblockStatus.getContext() != null) { - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); - - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().onEntityDeath(deathEvent); - } - RoomProcessor roomProcessor = null; - try { - DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); - if (dungeonRoom != null) { - if (dungeonRoom.getRoomProcessor() != null) { - dungeonRoom.getRoomProcessor().onEntityDeath(deathEvent); - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - - if (!(deathEvent.entityLiving instanceof EntityBat)) - DungeonActionManager.getSpawnLocation().remove(deathEvent.entity.getEntityId()); - } - -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java deleted file mode 100644 index bf3be41d..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.features; - -import kr.syeyoung.dungeonsguide.features.impl.advanced.FeatureDebug; -import kr.syeyoung.dungeonsguide.features.impl.advanced.FeatureDebuggableMap; -import kr.syeyoung.dungeonsguide.features.impl.advanced.FeatureRoomCoordDisplay; -import kr.syeyoung.dungeonsguide.features.impl.advanced.FeatureRoomDebugInfo; -import kr.syeyoung.dungeonsguide.features.impl.boss.*; -import kr.syeyoung.dungeonsguide.features.impl.boss.terminal.FeatureSimonSaysSolver; -import kr.syeyoung.dungeonsguide.features.impl.boss.terminal.FeatureTerminalSolvers; -import kr.syeyoung.dungeonsguide.features.impl.cosmetics.FeatureNicknameColor; -import kr.syeyoung.dungeonsguide.features.impl.cosmetics.FeatureNicknamePrefix; -import kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer.PartyInviteViewer; -import kr.syeyoung.dungeonsguide.features.impl.discord.onlinealarm.PlayingDGAlarm; -import kr.syeyoung.dungeonsguide.features.impl.dungeon.*; -import kr.syeyoung.dungeonsguide.features.impl.etc.*; -import kr.syeyoung.dungeonsguide.features.impl.etc.ability.FeatureAbilityCooldown; -import kr.syeyoung.dungeonsguide.features.impl.party.APIKey; -import kr.syeyoung.dungeonsguide.features.impl.party.FeaturePartyList; -import kr.syeyoung.dungeonsguide.features.impl.party.FeaturePartyReady; -import kr.syeyoung.dungeonsguide.features.impl.party.customgui.FeatureCustomPartyFinder; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; -import kr.syeyoung.dungeonsguide.features.impl.secret.*; -import kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser.FeatureMechanicBrowse; -import kr.syeyoung.dungeonsguide.features.impl.solvers.*; -import lombok.Getter; -import org.lwjgl.input.Keyboard; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeatureRegistry { - @Getter - private static final List<AbstractFeature> featureList = new ArrayList<AbstractFeature>(); - private static final Map<String, AbstractFeature> featureByKey = new HashMap<String, AbstractFeature>(); - @Getter - private static final Map<String, List<AbstractFeature>> featuresByCategory = new HashMap<String, List<AbstractFeature>>(); - @Getter - private static final Map<String, String> categoryDescription = new HashMap<>(); - - public static AbstractFeature getFeatureByKey(String key) { - return featureByKey.get(key); - } - - public static <T extends AbstractFeature> T register(T abstractFeature) { - if (featureByKey.containsKey(abstractFeature.getKey())) throw new IllegalArgumentException("DUPLICATE FEATURE DEFINITION"); - featureList.add(abstractFeature); - featureByKey.put(abstractFeature.getKey(), abstractFeature); - List<AbstractFeature> features = featuresByCategory.get(abstractFeature.getCategory()); - if (features == null) - features = new ArrayList<AbstractFeature>(); - features.add(abstractFeature); - featuresByCategory.put(abstractFeature.getCategory(), features); - - return abstractFeature; - } - - - - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_GLOBAL = register(new PathfindLineProperties("Dungeon Secrets", "Global Line Settings", "Global Line Settings", "secret.lineproperties.global", true, null)); - - - public static final FeatureMechanicBrowse SECRET_BROWSE = register(new FeatureMechanicBrowse()); - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_SECRET_BROWSER = register(new PathfindLineProperties("Dungeon Secrets.Secret Browser", "Line Settings", "Line Settings when pathfinding using Secret Browser", "secret.lineproperties.secretbrowser", true, SECRET_LINE_PROPERTIES_GLOBAL)); - public static final FeatureActions SECRET_ACTIONS = register(new FeatureActions()); - - public static final FeaturePathfindStrategy SECRET_PATHFIND_STRATEGY = register(new FeaturePathfindStrategy()); - public static final FeatureTogglePathfind SECRET_TOGGLE_KEY = register(new FeatureTogglePathfind()); - public static final FeatureFreezePathfind SECRET_FREEZE_LINES = register(new FeatureFreezePathfind()); - public static final FeatureCreateRefreshLine SECRET_CREATE_REFRESH_LINE = register(new FeatureCreateRefreshLine()); - static { - categoryDescription.put("ROOT.Dungeon Secrets.Keybinds", "Useful keybinds / Toggle Pathfind lines, Freeze Pathfind lines, Refresh pathfind line or Trigger pathfind (you would want to use it, if you're using Pathfind to All)"); - } - - - public static final SimpleFeature SECRET_AUTO_BROWSE_NEXT = register(new SimpleFeature("Dungeon Secrets.Legacy AutoPathfind", "Auto Pathfind to next secret", "Auto browse best next secret after current one completes.\nthe first pathfinding of first secret needs to be triggered first in order for this option to work", "secret.autobrowse", false)); - public static final SimpleFeature SECRET_AUTO_START = register(new SimpleFeature("Dungeon Secrets.Legacy AutoPathfind", "Auto pathfind to new secret", "Auto browse best secret upon entering the room.", "secret.autouponenter", false)); - public static final SimpleFeature SECRET_NEXT_KEY = register(new SimpleFeature("Dungeon Secrets.Legacy AutoPathfind", "Auto Pathfind to new secret upon pressing a key", "Auto browse the best next secret when you press key.\nPress settings to edit the key", "secret.keyfornext", false) { - { - parameters.put("key", new FeatureParameter<Integer>("key", "Key","Press to navigate to next best secret", Keyboard.KEY_NONE, "keybind")); - } - }); - - public static final SimpleFeature SECRET_BLOOD_RUSH = register(new FeatureBloodRush()); - public static final PathfindLineProperties SECRET_BLOOD_RUSH_LINE_PROPERTIES = register(new PathfindLineProperties("Dungeon Secrets.Blood Rush", "Blood Rush Line Settings", "Line Settings to be used", "secret.lineproperties.bloodrush", false, SECRET_LINE_PROPERTIES_GLOBAL)); - - - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_AUTOPATHFIND = register(new PathfindLineProperties("Dungeon Secrets.Legacy AutoPathfind", "Line Settings", "Line Settings when pathfinding using above features", "secret.lineproperties.autopathfind", true, SECRET_LINE_PROPERTIES_GLOBAL)); - - public static final FeaturePathfindToAll SECRET_PATHFIND_ALL = register(new FeaturePathfindToAll()); - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT = register(new PathfindLineProperties("Dungeon Secrets.Pathfind To All", "Parent Line Settings", "Line Settings to be used by default", "secret.lineproperties.apf.parent", false, SECRET_LINE_PROPERTIES_GLOBAL)); - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_BAT = register(new PathfindLineProperties("Dungeon Secrets.Pathfind To All", "Bat Line Settings", "Line Settings when pathfind to Bat, when using above feature", "secret.lineproperties.apf.bat", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_CHEST = register(new PathfindLineProperties("Dungeon Secrets.Pathfind To All", "Chest Line Settings", "Line Settings when pathfind to Chest, when using above feature", "secret.lineproperties.apf.chest", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_ESSENCE = register(new PathfindLineProperties("Dungeon Secrets.Pathfind To All", "Essence Line Settings", "Line Settings when pathfind to Essence, when using above feature", "secret.lineproperties.apf.essence", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); - public static final PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_ITEM_DROP = register(new PathfindLineProperties("Dungeon Secrets.Pathfind To All", "Item Drop Line Settings", "Line Settings when pathfind to Item Drop, when using above feature", "secret.lineproperties.apf.itemdrop", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); - - public static final FeatureSolverRiddle SOLVER_RIDDLE = register(new FeatureSolverRiddle()); - public static final FeatureSolverTictactoe SOLVER_TICTACTOE = register(new FeatureSolverTictactoe()); - public static final SimpleFeature SOLVER_WATERPUZZLE = register(new SimpleFeature("Solver.Any Floor", "Waterboard (Advanced)", "Calculates solution for waterboard puzzle and displays it to user", "solver.waterboard")); - public static final SimpleFeature SOLVER_CREEPER = register(new SimpleFeature("Solver.Any Floor", "Creeper", "Draws line between prismarine lamps in creeper room", "solver.creeper")); - public static final FeatureSolverTeleport SOLVER_TELEPORT = register(new FeatureSolverTeleport()); - public static final FeatureSolverBlaze SOLVER_BLAZE = register(new FeatureSolverBlaze()); - public static final FeatureSolverIcefill SOLVER_ICEPATH = register(new FeatureSolverIcefill()); - public static final FeatureSolverSilverfish SOLVER_SILVERFISH = register(new FeatureSolverSilverfish()); - public static final FeatureSolverBox SOLVER_BOX = register(new FeatureSolverBox()); - public static final FeatureSolverKahoot SOLVER_KAHOOT = register(new FeatureSolverKahoot()); - public static final FeatureSolverBombdefuse SOLVER_BOMBDEFUSE = register(new FeatureSolverBombdefuse()); - - - public static final FeatureDungeonMap DUNGEON_MAP = register(new FeatureDungeonMap()); - public static final FeatureDungeonRoomName DUNGEON_ROOMNAME = register(new FeatureDungeonRoomName()); - public static final FeaturePressAnyKeyToCloseChest DUNGEON_CLOSECHEST = register(new FeaturePressAnyKeyToCloseChest()); - public static final FeatureBoxSkelemaster DUNGEON_BOXSKELEMASTER = register(new FeatureBoxSkelemaster()); - public static final FeatureBoxBats DUNGEON_BOXBAT = register(new FeatureBoxBats()); - public static final FeatureBoxStarMobs DUNGEON_BOXSTARMOBS = register(new FeatureBoxStarMobs()); - public static final FeatureWatcherWarning DUNGEON_WATCHERWARNING = register(new FeatureWatcherWarning()); - public static final FeatureDungeonDeaths DUNGEON_DEATHS = register(new FeatureDungeonDeaths()); - public static final FeatureDungeonMilestone DUNGEON_MILESTONE = register(new FeatureDungeonMilestone()); - public static final FeatureDungeonRealTime DUNGEON_REALTIME = register(new FeatureDungeonRealTime()); - public static final FeatureDungeonSBTime DUNGEON_SBTIME = register(new FeatureDungeonSBTime()); - public static final FeatureDungeonSecrets DUNGEON_SECRETS = register(new FeatureDungeonSecrets()); - public static final FeatureDungeonCurrentRoomSecrets DUNGEON_SECRETS_ROOM = register(new FeatureDungeonCurrentRoomSecrets()); - public static final FeatureDungeonTombs DUNGEON_TOMBS = register(new FeatureDungeonTombs()); - public static final FeatureDungeonScore DUNGEON_SCORE = register(new FeatureDungeonScore()); - public static final FeatureWarnLowHealth DUNGEON_LOWHEALTH_WARN = register(new FeatureWarnLowHealth()); - public static final SimpleFeature DUNGEON_INTERMODCOMM = register(new SimpleFeature("Dungeon.Teammates", "Communicate With Other's Dungeons Guide", "Sends total secret in the room to others\nSo that they can use the data to calculate total secret in dungeon run\n\nThis automates player chatting action, (chatting data) Thus it might be against hypixel's rules.\nBut mods like auto-gg which also automate player action and is kinda allowed mod exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "dungeon.intermodcomm", false)); - public static final FeaturePlayerESP DUNGEON_PLAYERESP = register(new FeaturePlayerESP()); - public static final FeatureHideNameTags DUNGEON_HIDENAMETAGS = register(new FeatureHideNameTags()); - public static final FeatureSoulRoomWarning DUNGEON_FAIRYSOUL = register(new FeatureSoulRoomWarning()); - - public static final FeatureWarningOnPortal BOSSFIGHT_WARNING_ON_PORTAL = register(new FeatureWarningOnPortal()); - public static final SimpleFeature BOSSFIGHT_CHESTPRICE = register(new FeatureChestPrice()); - public static final FeatureAutoReparty BOSSFIGHT_AUTOREPARTY = register(new FeatureAutoReparty()); - public static final FeatureBossHealth BOSSFIGHT_HEALTH = register(new FeatureBossHealth()); - public static final FeatureHideAnimals BOSSFIGHT_HIDE_ANIMALS = register(new FeatureHideAnimals()); - public static final FeatureThornBearPercentage BOSSFIGHT_BEAR_PERCENT = register(new FeatureThornBearPercentage()); - public static final FeatureThornSpiritBowTimer BOSSFIGHT_BOW_TIMER = register(new FeatureThornSpiritBowTimer()); - public static final FeatureBoxRealLivid BOSSFIGHT_BOX_REALLIVID = register(new FeatureBoxRealLivid()); - public static final FeatureTerracotaTimer BOSSFIGHT_TERRACOTTA_TIMER = register(new FeatureTerracotaTimer()); - public static final FeatureCurrentPhase BOSSFIGHT_CURRENT_PHASE = register(new FeatureCurrentPhase()); - public static final FeatureTerminalSolvers BOSSFIGHT_TERMINAL_SOLVERS = register(new FeatureTerminalSolvers()); - public static final FeatureSimonSaysSolver BOSSFIGHT_SIMONSAYS_SOLVER = register(new FeatureSimonSaysSolver()); - - public static final APIKey PARTYKICKER_APIKEY = register(new APIKey()); - public static final FeatureViewPlayerStatsOnJoin PARTYKICKER_VIEWPLAYER = register(new FeatureViewPlayerStatsOnJoin()); - public static final FeatureCustomPartyFinder PARTYKICKER_CUSTOM = register(new FeatureCustomPartyFinder()); - public static final FeaturePartyList PARTY_LIST = register(new FeaturePartyList()); - public static final FeaturePartyReady PARTY_READY = register(new FeaturePartyReady()); - - public static final FeatureTooltipDungeonStat ETC_DUNGEONSTAT = register(new FeatureTooltipDungeonStat()); - public static final FeatureTooltipPrice ETC_PRICE = register(new FeatureTooltipPrice()); - public static final FeatureAbilityCooldown ETC_ABILITY_COOLDOWN = register(new FeatureAbilityCooldown()); - public static final FeatureCooldownCounter ETC_COOLDOWN = register(new FeatureCooldownCounter()); - public static final FeatureRepartyCommand ETC_REPARTY = register(new FeatureRepartyCommand()); - public static final FeatureDecreaseExplosionSound ETC_EXPLOSION_SOUND = register(new FeatureDecreaseExplosionSound()); - public static final FeatureAutoAcceptReparty ETC_AUTO_ACCEPT_REPARTY = register(new FeatureAutoAcceptReparty()); - public static final FeatureUpdateAlarm ETC_TEST = register(new FeatureUpdateAlarm()); - - public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature("Misc", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true)); - public static final FeatureDisableMessage FIX_MESSAGES = register(new FeatureDisableMessage()); - - public static final FeatureCopyMessages ETC_COPY_MSG = register(new FeatureCopyMessages()); - - public static final FeaturePenguins ETC_PENGUIN = register(new FeaturePenguins()); - - public static final FeatureCollectScore ETC_COLLECT_SCORE = register(new FeatureCollectScore()); - - - - - - public static final FeatureNicknamePrefix COSMETIC_PREFIX = register(new FeatureNicknamePrefix()); - public static final FeatureNicknameColor COSMETIC_NICKNAMECOLOR = register(new FeatureNicknameColor()); - - - - public static final SimpleFeature DISCORD_RICHPRESENCE = register(new SimpleFeature("Discord", "Discord RPC", "Enable Discord rich presence", "advanced.richpresence", true) { - { - parameters.put("disablenotskyblock", new FeatureParameter<Boolean>("disablenotskyblock", "Disable When not on Skyblock", "Disable When not on skyblock", false, "boolean")); - } - }); - public static final PartyInviteViewer DISCORD_ASKTOJOIN = register(new PartyInviteViewer()); - public static final PlayingDGAlarm DISCORD_ONLINEALARM = register(new PlayingDGAlarm()); - public static final SimpleFeature DISCORD_DONOTUSE = register(new SimpleFeature("Discord", "Disable Native Library", "Disables usage of jna for discord rpc support.\nBreaks any discord related feature in the mod.\nRequires mod restart to get affected.\n\nThis feature is only for those whose minecraft crashes due to discord gamesdk crash.", "discord.rpc", false)); - - - public static final SimpleFeature DEBUG = register(new FeatureDebug()); - public static final SimpleFeature ADVANCED_ROOMEDIT = register(new SimpleFeature("Advanced", "Room Edit", "Allow editing dungeon rooms\n\nWarning: using this feature can break or freeze your Minecraft\nThis is only for advanced users only", "advanced.roomedit", false){ - { - parameters.put("key", new FeatureParameter<Integer>("key", "Key","Press to edit room", Keyboard.KEY_R, "keybind")); - } - }); - - public static final FeatureRoomDebugInfo ADVANCED_DEBUG_ROOM = register(new FeatureRoomDebugInfo()); - public static final FeatureDebuggableMap ADVANCED_DEBUGGABLE_MAP = register(new FeatureDebuggableMap()); - public static final FeatureRoomCoordDisplay ADVANCED_COORDS = register(new FeatureRoomCoordDisplay()); - -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebug.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebug.java deleted file mode 100644 index a254f0db..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebug.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.features.impl.advanced; - -import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; - -public class FeatureDebug extends SimpleFeature { - public FeatureDebug() { - super("Advanced", "Debug", "Toggles debug mode", "debug", false); - parameters.put("Key", new FeatureParameter<String>("Key", "Secret Key given by syeyoung", "Put the debug enable key here to enable debug mode", "","string")); - } - @Override - public boolean isEnabled() { - return "just hide it".equals(this.<String>getParameter("Key").getValue()); - } - @Override - public boolean isDisyllable() { - return false; - } - - @Override - public String getEditRoute(RootConfigPanel rootConfigPanel) { - ConfigPanelCreator.map.put("base." + getKey() , new Supplier<MPanel>() { - @Override - public MPanel get() { - MFeatureEdit featureEdit = new MFeatureEdit(FeatureDebug.this, rootConfigPanel); - for (FeatureParameter parameter: getParameters()) { - featureEdit.addParameterEdit(parameter.getKey(), new MParameterEdit(FeatureDebug.this, parameter, rootConfigPanel)); - } - featureEdit.addParameterEdit("IsEnabled", new MParameterEdit(FeatureDebug.this, new FeatureParameter("Key Status", "Key Status", "Key Enabled? Or not?", "", "idk"), rootConfigPanel, new MLabel() { - @Override - public String getText() { - return isEnabled() ? "Enabled!" : "Incorrect Key"; - } - }, (a) -> false)); - return featureEdit; - } - }); - return "base." + getKey() ; - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java deleted file mode 100644 index fa8d214c..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.features.impl.dungeon; - -import com.google.common.collect.ComparisonChain; -import com.google.common.collect.Ordering; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.MapProcessor; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.features.listener.BossroomEnterListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonStartListener; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import net.minecraft.block.material.MapColor; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.network.NetworkPlayerInfo; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.texture.DynamicTexture; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EnumPlayerModelParts; -import net.minecraft.scoreboard.ScorePlayerTeam; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec4b; -import net.minecraft.world.WorldSettings; -import net.minecraft.world.storage.MapData; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import org.jetbrains.annotations.Nullable; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; - -import javax.vecmath.Vector2d; -import java.awt.*; -import java.util.Comparator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, DungeonStartListener, BossroomEnterListener { - public FeatureDungeonMap() { - super("Dungeon", "Dungeon Map", "Display dungeon map!", "dungeon.map", true, 128, 128); - this.setEnabled(false); - parameters.put("scale", new FeatureParameter<>("scale", "Scale map", "Whether to scale map to fit screen", true, "boolean")); - parameters.put("playerCenter", new FeatureParameter<>("playerCenter", "Center map at player", "Render you in the center", false, "boolean")); - parameters.put("rotate", new FeatureParameter<>("rotate", "Rotate map centered at player", "Only works with Center map at player enabled", false, "boolean")); - parameters.put("postScale", new FeatureParameter<>("postScale", "Scale factor of map", "Only works with Center map at player enabled", 1.0f, "float")); - parameters.put("useplayerheads", new FeatureParameter<>("useplayerheads", "Use player heads instead of arrows", "Option to use player heads instead of arrows", true, "boolean")); - parameters.put("showotherplayers", new FeatureParameter<>("showotherplayers", "Show other players", "Option to show other players in map", true, "boolean")); - parameters.put("showtotalsecrets", new FeatureParameter<>("showtotalsecrets", "Show Total secrets in the room", "Option to overlay total secrets in the specific room", true, "boolean")); - parameters.put("playerheadscale", new FeatureParameter<>("playerheadscale", "Player head scale", "Scale factor of player heads, defaults to 1", 1.0f, "float")); - parameters.put("textScale", new FeatureParameter<>("textScale", "Text scale", "Scale factor of texts on map, defaults to 1", 1.0f, "float")); - - parameters.put("border_color", new FeatureParameter<>("border_color", "Color of the border", "Same as name", new AColor(255, 255, 255, 255), "acolor")); - parameters.put("background_color", new FeatureParameter<>("background_color", "Color of the background", "Same as name", new AColor(0x22000000, true), "acolor")); - parameters.put("player_color", new FeatureParameter<>("player_color", "Color of the player border", "Same as name", new AColor(255, 255, 255, 0), "acolor")); - } - - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - public static final Ordering<NetworkPlayerInfo> field_175252_a = Ordering.from(new PlayerComparator()); - - private boolean on = false; - - @Override - public void onDungeonEnd() { - on = false; - } - - @Override - public void onDungeonStart() { - on = true; - } - - @Override - public void onBossroomEnter() { - on = false; - } - - @SideOnly(Side.CLIENT) - static class PlayerComparator implements Comparator<NetworkPlayerInfo> { - private PlayerComparator() { - } - - public int compare(NetworkPlayerInfo compare1, NetworkPlayerInfo compare2) { - ScorePlayerTeam scoreplayerteam = compare1.getPlayerTeam(); - ScorePlayerTeam scoreplayerteam1 = compare2.getPlayerTeam(); - return ComparisonChain.start().compareTrueFirst(compare1.getGameType() != WorldSettings.GameType.SPECTATOR, compare2.getGameType() != WorldSettings.GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "").compare(compare1.getGameProfile().getName(), compare2.getGameProfile().getName()).result(); - } - } - - @Override - public void drawHUD(float partialTicks) { - if (!skyblockStatus.isOnDungeon()) return; - if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) - return; - if (!on) return; - - DungeonContext context = skyblockStatus.getContext(); - MapProcessor mapProcessor = context.getMapProcessor(); - MapData mapData = mapProcessor.getLastMapData2(); - Rectangle featureRect = getFeatureRect().getRectangle(); - Gui.drawRect(0, 0, featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, this.<AColor>getParameter("background_color").getValue())); - GlStateManager.color(1, 1, 1, 1); - GlStateManager.pushMatrix(); - if (mapData == null) { - Gui.drawRect(0, 0, featureRect.width, featureRect.height, 0xFFFF0000); - } else { - renderMap(partialTicks, mapProcessor, mapData, context); - } - GlStateManager.popMatrix(); - GL11.glLineWidth(2); - RenderUtils.drawUnfilledBox(0, 0, featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); - } - - @Override - public void drawDemo(float partialTicks) { - if (skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getMapProcessor().isInitialized() && on) { - drawHUD(partialTicks); - return; - } - Rectangle featureRect = getFeatureRect().getRectangle(); - Gui.drawRect(0, 0, featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, this.<AColor>getParameter("background_color").getValue())); - FontRenderer fr = getFontRenderer(); - - GlStateManager.enableBlend(); - GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - fr.drawString("Please join a dungeon to see preview", featureRect.width / 2 - fr.getStringWidth("Please join a dungeon to see preview") / 2, featureRect.height / 2 - fr.FONT_HEIGHT / 2, 0xFFFFFFFF); - GL11.glLineWidth(2); - RenderUtils.drawUnfilledBox(0, 0, featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); - } - - public void renderMap(float partialTicks, MapProcessor mapProcessor, MapData mapData, DungeonContext context) { - float postScale; - if (this.<Boolean>getParameter("playerCenter").getValue()) { - postScale = this.<Float>getParameter("postScale").getValue(); - } else { - postScale = 1; - } - Rectangle featureRect = getFeatureRect().getRectangle(); - int width = featureRect.width; - float scale; - if (this.<Boolean>getParameter("scale").getValue()) { - scale = width / 128.0f; - } else { - scale = 1; - } - GlStateManager.translate(width / 2d, width / 2d, 0); - GlStateManager.scale(scale, scale, 0); - GlStateManager.scale(postScale, postScale, 0); - EntityPlayer p = Minecraft.getMinecraft().thePlayer; - - Vector2d pt = mapProcessor.worldPointToMapPointFLOAT(p.getPositionEyes(partialTicks)); - double yaw = p.rotationYaw; - if (this.<Boolean>getParameter("playerCenter").getValue()) { - if (this.<Boolean>getParameter("rotate").getValue()) { - GlStateManager.rotate((float) (180.0 - yaw), 0, 0, 1); - } - GlStateManager.translate(-pt.x, -pt.y, 0); - } else { - GlStateManager.translate(-64, -64, 0); - } - updateMapTexture(mapData.colors, mapProcessor, context.getDungeonRoomList()); - render(); - - - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1); - - if (this.<Boolean>getParameter("useplayerheads").getValue()) { - renderHeads(mapProcessor, mapData, scale, postScale, partialTicks); - } else { - renderArrows(mapData, scale, postScale); - } - - - FontRenderer fr = getFontRenderer(); - if (this.<Boolean>getParameter("showtotalsecrets").getValue()) { - for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { - GlStateManager.pushMatrix(); - - Point mapPt = mapProcessor.roomPointToMapPoint(dungeonRoom.getUnitPoints().get(0)); - GlStateManager.translate(mapPt.x + mapProcessor.getUnitRoomDimension().width / 2d, mapPt.y + mapProcessor.getUnitRoomDimension().height / 2d, 0); - - if (this.<Boolean>getParameter("playerCenter").getValue() && this.<Boolean>getParameter("rotate").getValue()) { - GlStateManager.rotate((float) (yaw - 180), 0, 0, 1); - } - GlStateManager.scale(1 / scale, 1 / scale, 0); - GlStateManager.scale(1 / postScale, 1 / postScale, 0); - float s = this.<Float>getParameter("textScale").getValue(); - GlStateManager.scale(s, s, 0); - String str = ""; - str += dungeonRoom.getTotalSecrets() == -1 ? "?" : String.valueOf(dungeonRoom.getTotalSecrets()); - str += " "; - if (dungeonRoom.getCurrentState() == DungeonRoom.RoomState.FINISHED) { - str += "✔"; - } else if (dungeonRoom.getCurrentState() == DungeonRoom.RoomState.COMPLETE_WITHOUT_SECRETS) { - str += "☑"; - } else if (dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) { - str += "☐"; - } else if (dungeonRoom.getCurrentState() == DungeonRoom.RoomState.FAILED) { - str += "❌"; - } - - - GlStateManager.enableBlend(); - GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - if (dungeonRoom.getCurrentState() == DungeonRoom.RoomState.FINISHED) - fr.drawString(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), 0xFF00FF00); - else { - if (dungeonRoom.getColor() == 74) - fr.drawString(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), 0xff000000); - else fr.drawString(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), 0xFFFFFFFF); - } - - GlStateManager.popMatrix(); - } - } - - } - - - private final DynamicTexture mapTexture = new DynamicTexture(128, 128); - private final ResourceLocation location = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("dungeonmap/map", mapTexture); - private final int[] mapTextureData = mapTexture.getTextureData(); - - private void updateMapTexture(byte[] colors, MapProcessor mapProcessor, List<DungeonRoom> dungeonRooms) { - for (int i = 0; i < 16384; ++i) { - int j = colors[i] & 255; - - if (j / 4 == 0) { - this.mapTextureData[i] = 0x00000000; - } else { - this.mapTextureData[i] = MapColor.mapColorArray[j / 4].getMapColor(j & 3); - } - } - - if (this.<Boolean>getParameter("showtotalsecrets").getValue()) { - for (DungeonRoom dungeonRoom : dungeonRooms) { - for (Point pt : dungeonRoom.getUnitPoints()) { - for (int y1 = 0; y1 < mapProcessor.getUnitRoomDimension().height; y1++) { - for (int x1 = 0; x1 < mapProcessor.getUnitRoomDimension().width; x1++) { - int x = MathHelper.clamp_int(pt.x * (mapProcessor.getUnitRoomDimension().width + mapProcessor.getDoorDimension().height) + x1 + mapProcessor.getTopLeftMapPoint().x, 0, 128); - int y = MathHelper.clamp_int(pt.y * (mapProcessor.getUnitRoomDimension().height + mapProcessor.getDoorDimension().height) + y1 + mapProcessor.getTopLeftMapPoint().y, 0, 128); - int i = y * 128 + x; - int j = dungeonRoom.getColor(); - - if (j / 4 == 0) { - this.mapTextureData[i] = 0x00000000; - } else { - this.mapTextureData[i] = MapColor.mapColorArray[j / 4].getMapColor(j & 3); - } - } - } - } - } - } - - - this.mapTexture.updateDynamicTexture(); - } - - - private void renderHeads(MapProcessor mapProcessor, MapData mapData, float scale, float postScale, float partialTicks) { - List<NetworkPlayerInfo> list = field_175252_a.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); - if (list.size() < 40) return; - - // 19 iterations bc we only want to scan the player part of tab list - for (int i = 1; i < 20; i++) { - NetworkPlayerInfo networkPlayerInfo = list.get(i); - - String name = getPlayerNameWithChecks(networkPlayerInfo); - if (name == null) continue; - - - EntityPlayer entityplayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(name); - - Vector2d pt2; - double yaw2; - - - if (entityplayer != null && (!entityplayer.isInvisible() || entityplayer == Minecraft.getMinecraft().thePlayer)) { - pt2 = mapProcessor.worldPointToMapPointFLOAT(entityplayer.getPositionEyes(partialTicks)); - yaw2 = entityplayer.prevRotationYawHead + (entityplayer.rotationYawHead - entityplayer.prevRotationYawHead) * partialTicks; - } else { - String iconName = mapProcessor.getMapIconToPlayerMap().get(name); - if (iconName == null) continue; - Vec4b vec = mapData.mapDecorations.get(iconName); - if (vec == null) { - continue; - } else { - pt2 = new Vector2d(vec.func_176112_b() / 2d + 64, vec.func_176113_c() / 2d + 64); - yaw2 = vec.func_176111_d() * 360 / 16.0f; - } - } - - GlStateManager.pushMatrix(); - - boolean showOtherPlayers = this.<Boolean>getParameter("showotherplayers").getValue(); - - if (entityplayer == Minecraft.getMinecraft().thePlayer || showOtherPlayers) { - boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE); - GlStateManager.enableTexture2D(); - Minecraft.getMinecraft().getTextureManager().bindTexture(networkPlayerInfo.getLocationSkin()); - int l2 = 8 + (flag1 ? 8 : 0); - int i3 = 8 * (flag1 ? -1 : 1); - - GlStateManager.translate(pt2.x, pt2.y, 0); - GlStateManager.rotate((float) yaw2, 0, 0, 1); - - GlStateManager.scale(1 / scale, 1 / scale, 0); - GlStateManager.scale(1 / postScale, 1 / postScale, 0); - - float s = this.<Float>getParameter("playerheadscale").getValue(); - GlStateManager.scale(s, s, 0); - - // cutting out the player head out of the skin texture - Gui.drawScaledCustomSizeModalRect(-4, -4, 8.0F, l2, 8, i3, 8, 8, 64.0F, 64.0F); - GL11.glLineWidth(1); - RenderUtils.drawUnfilledBox(-4, -4, 4, 4, this.<AColor>getParameter("player_color").getValue()); - } - GlStateManager.popMatrix(); - } - } - - final Pattern tabListRegex = Pattern.compile("\\*[a-zA-Z0-9_]{2,16}\\*", Pattern.MULTILINE); - - /** - * We make sure that the player is alive and regex their name out - * @param networkPlayerInfo the network player info of player - * @return the username of player - */ - @Nullable - private String getPlayerNameWithChecks(NetworkPlayerInfo networkPlayerInfo) { - String name; - if (networkPlayerInfo.getDisplayName() != null) { - name = networkPlayerInfo.getDisplayName().getFormattedText(); - } else { - name = ScorePlayerTeam.formatPlayerName( - networkPlayerInfo.getPlayerTeam(), - networkPlayerInfo.getGameProfile().getName() - ); - } - - if (name.trim().equals("§r") || name.startsWith("§r ")) return null; - - name = TextUtils.stripColor(name); - - if(name.contains("(DEAD)")) { - return null; - } - - name = name.replace(" ", "*"); - - Matcher matcher = tabListRegex.matcher(name); - if (!matcher.find()) return null; - - name = matcher.group(0); - name = name.substring(0, name.length() - 1); - name = name.substring(1); - return name; - } - - - private static final ResourceLocation mapIcons = new ResourceLocation("textures/map/map_icons.png"); - - private void renderArrows(MapData mapData, float scale, float postScale) { - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - int k = 0; - Minecraft.getMinecraft().getTextureManager().bindTexture(mapIcons); - for (Vec4b vec4b : mapData.mapDecorations.values()) { - if (vec4b.func_176110_a() == 1 || this.<Boolean>getParameter("showotherplayers").getValue()) { - GlStateManager.pushMatrix(); - GlStateManager.translate(vec4b.func_176112_b() / 2.0F + 64.0F, vec4b.func_176113_c() / 2.0F + 64.0F, -0.02F); - GlStateManager.rotate((vec4b.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F); - - GlStateManager.scale(1 / scale, 1 / scale, 0); - GlStateManager.scale(1 / postScale, 1 / postScale, 0); - float s = this.<Float>getParameter("playerheadscale").getValue(); - GlStateManager.scale(s * 5, s * 5, 0); - - GlStateManager.translate(-0.125F, 0.125F, 0.0F); - byte b0 = vec4b.func_176110_a(); - float f1 = (b0 % 4) / 4.0F; - float f2 = (b0 / 4f) / 4.0F; - float f3 = (b0 % 4 + 1) / 4.0F; - float f4 = (b0 / 4f + 1) / 4.0F; - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); - worldrenderer.pos(-1.0D, 1.0D, k * -0.001F).tex(f1, f2).endVertex(); - worldrenderer.pos(1.0D, 1.0D, k * -0.001F).tex(f3, f2).endVertex(); - worldrenderer.pos(1.0D, -1.0D, k * -0.001F).tex(f3, f4).endVertex(); - worldrenderer.pos(-1.0D, -1.0D, k * -0.001F).tex(f1, f4).endVertex(); - tessellator.draw(); - GlStateManager.popMatrix(); - ++k; - } - } - } - - private void render() { - int i = 0; - int j = 0; - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - float f = 0.0F; - Minecraft.getMinecraft().getTextureManager().bindTexture(this.location); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1); - GlStateManager.disableAlpha(); - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); - worldrenderer.pos((i) + f, (j + 128) - f, -0.009999999776482582D).tex(0.0D, 1.0D).endVertex(); - worldrenderer.pos((i + 128) - f, (j + 128) - f, -0.009999999776482582D).tex(1.0D, 1.0D).endVertex(); - worldrenderer.pos((i + 128) - f, (j) + f, -0.009999999776482582D).tex(1.0D, 0.0D).endVertex(); - worldrenderer.pos((i) + f, (j) + f, -0.009999999776482582D).tex(0.0D, 0.0D).endVertex(); - tessellator.draw(); - GlStateManager.enableAlpha(); - GlStateManager.disableBlend(); - - GlStateManager.pushMatrix(); - GlStateManager.translate(0.0F, 0.0F, -0.04F); - GlStateManager.scale(1.0F, 1.0F, 1.0F); - GlStateManager.popMatrix(); - } - -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/PlayerSkyblockData.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/PlayerSkyblockData.java deleted file mode 100644 index 72b28e61..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/PlayerSkyblockData.java +++ /dev/null @@ -1,10 +0,0 @@ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api; - -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import lombok.Data; - -@Data -public class PlayerSkyblockData { - PlayerProfile[] playerProfiles; - int lastestprofileArrayIndex; -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java deleted file mode 100644 index e492bd1c..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.features.impl.secret; - -import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.KeybindPressedListener; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MKeyEditButton; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings; -import net.minecraft.util.ChatComponentText; -import org.lwjgl.input.Keyboard; - -public class FeatureFreezePathfind extends SimpleFeature implements KeybindPressedListener { - public FeatureFreezePathfind() { - super("Dungeon Secrets.Keybinds", "Global Freeze Pathfind", "Freeze Pathfind, meaning the pathfind lines won't change when you move.\nPress settings to edit the key", "secret.freezepathfind", false); - this.parameters.put("key", new FeatureParameter<Integer>("key", "Key", "Press to toggle freeze pathfind", Keyboard.KEY_NONE, "keybind")); - } - - @Override - public void onKeybindPress(KeyBindPressedEvent keyBindPressedEvent) { - if (keyBindPressedEvent.getKey() == this.<Integer>getParameter("key").getValue()) { - setEnabled(!isEnabled()); - try { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fToggled Pathfind Freeze to §e"+(FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() ? "on":"off"))); - } catch (Exception ignored) {} - } - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBlaze.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBlaze.java deleted file mode 100644 index 1e698414..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBlaze.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.features.impl.solvers; - -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; - -public class FeatureSolverBlaze extends SimpleFeature { - public FeatureSolverBlaze() { - super("Solver.Floor 2+", "Blaze", "Highlights the blaze that needs to be killed in an blaze room", "solver.blaze"); - parameters.put("normBlazeColor", new FeatureParameter<AColor>("blazecolor", "Normal Blaze Color", "Normal Blaze Color", new AColor(255,255,255,255), "acolor")); - parameters.put("nextBlazeColor", new FeatureParameter<AColor>("blazecolor", "Next Blaze Color", "Next Blaze Color", new AColor(0,255,0,255), "acolor")); - parameters.put("nextUpBlazeColor", new FeatureParameter<AColor>("blazecolor", "Next Up Blaze Color", "Color of blaze after next blaze", new AColor(255,255,0,255), "acolor")); - parameters.put("blazeborder", new FeatureParameter<AColor>("blazeborder", "Blaze Border Color", "Blaze border color", new AColor(255,255,255,0), "acolor")); - } - - public AColor getBlazeColor() { - return this.<AColor>getParameter("normBlazeColor").getValue(); - } - public AColor getNextBlazeColor() { - return this.<AColor>getParameter("nextBlazeColor").getValue(); - } - public AColor getNextUpBlazeColor() { - return this.<AColor>getParameter("nextUpBlazeColor").getValue(); - } - public AColor getBorder() { - return this.<AColor>getParameter("blazeborder").getValue(); - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java new file mode 100755 index 00000000..45c403fd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java @@ -0,0 +1,260 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod; + +import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.IDungeonGuide; +import kr.syeyoung.dungeonsguide.Main; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.commands.CommandDgDebug; +import kr.syeyoung.dungeonsguide.mod.commands.CommandDungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.commands.CommandReparty; +import kr.syeyoung.dungeonsguide.mod.config.Config; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.RichPresenceManager; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonFacade; +import kr.syeyoung.dungeonsguide.mod.events.listener.FeatureListener; +import kr.syeyoung.dungeonsguide.mod.events.listener.PacketListener; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.resources.DGTexturePack; +import kr.syeyoung.dungeonsguide.mod.utils.AhUtils; +import kr.syeyoung.dungeonsguide.mod.utils.BlockCache; +import kr.syeyoung.dungeonsguide.mod.utils.TimeScoreUtil; +import kr.syeyoung.dungeonsguide.mod.utils.TitleRender; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.GLCursors; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.*; +import net.minecraft.client.resources.IReloadableResourceManager; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.launchwrapper.LaunchClassLoader; +import net.minecraftforge.client.ClientCommandHandler; +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.ProgressManager; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +public class DungeonsGuide implements IDungeonGuide { + + @Getter + private static boolean firstTimeUsingDG = false; + Logger logger = LogManager.getLogger("DungeonsGuide"); + + public boolean verbose = false; + private SkyblockStatus skyblockStatus; + + @Getter + private CosmeticsManager cosmeticsManager; + @Getter + private DungeonFacade dungeonFacade; + + @Getter + private BlockCache blockCache; + + public DungeonsGuide(){ + instance = this; + } + private static DungeonsGuide instance; + + public static DungeonsGuide getDungeonsGuide() { + return instance; + } + + @Getter + CommandReparty commandReparty; + + + + + public void init() { + ProgressManager.ProgressBar progressbar = ProgressManager.push("DungeonsGuide", 4); + MinecraftForge.EVENT_BUS.register(this); + + progressbar.step("Registering Events & Commands"); + + skyblockStatus = new SkyblockStatus(); + + MinecraftForge.EVENT_BUS.register(skyblockStatus); + + + (new FeatureRegistry()).init(); + + new ChatTransmitter(); + + try { + Set<String> invalid = ReflectionHelper.getPrivateValue(LaunchClassLoader.class, (LaunchClassLoader) Main.class.getClassLoader(), "invalidClasses"); + ((LaunchClassLoader) Main.class.getClassLoader()).clearNegativeEntries(Sets.newHashSet("org.slf4j.LoggerFactory")); + invalid.clear(); + } catch (Exception e) { + e.printStackTrace(); + } + + + this.blockCache = new BlockCache(); + + this.dungeonFacade = new DungeonFacade(); + dungeonFacade.init(); + + + + TitleRender.getInstance(); + + CommandDungeonsGuide commandDungeonsGuide = new CommandDungeonsGuide(); + CommandDgDebug command = new CommandDgDebug(); + + ClientCommandHandler.instance.registerCommand(commandDungeonsGuide); + ClientCommandHandler.instance.registerCommand(command); + + MinecraftForge.EVENT_BUS.register(command); + MinecraftForge.EVENT_BUS.register(commandDungeonsGuide); + + commandReparty = new CommandReparty(); + MinecraftForge.EVENT_BUS.register(commandReparty); + + MinecraftForge.EVENT_BUS.register(new FeatureListener()); + MinecraftForge.EVENT_BUS.register(new PacketListener()); + MinecraftForge.EVENT_BUS.register(new Keybinds()); + + MinecraftForge.EVENT_BUS.register(PartyManager.INSTANCE); + MinecraftForge.EVENT_BUS.register(ChatProcessor.INSTANCE); + MinecraftForge.EVENT_BUS.register(StaticResourceCache.INSTANCE); + + MinecraftForge.EVENT_BUS.register(new AhUtils()); + + + progressbar.step("Opening connection"); + cosmeticsManager = new CosmeticsManager(); + MinecraftForge.EVENT_BUS.register(cosmeticsManager); + + + progressbar.step("Loading Config"); + try { + Config.loadConfig(null); + } catch (IOException e) { + e.printStackTrace(); + } + + if (FeatureRegistry.ETC_REPARTY.isEnabled()) { + ClientCommandHandler.instance.registerCommand(commandReparty); + } + + if (FeatureRegistry.DISCORD_DONOTUSE.isEnabled()) { + System.setProperty("dg.safe", "true"); + } + + MinecraftForge.EVENT_BUS.register(RichPresenceManager.INSTANCE); + TimeScoreUtil.init(); + + Main.finishUpProgressBar(progressbar); + + ProgressManager.pop(progressbar); + + ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(resourceManager -> GLCursors.setupCursors()); + } + + private boolean showedStartUpGuide; + @SubscribeEvent + public void onGuiOpen(GuiOpenEvent guiOpenEvent){ + if(!showedStartUpGuide){ + showedStartUpGuide = true; + + if(isFirstTimeUsingDG()){ + GuiScreen originalGUI = guiOpenEvent.gui; + guiOpenEvent.gui = new GuiScreen() { + final String welcomeText = "Thank you for installing §eDungeonsGuide§f, the most intelligent skyblock dungeon mod!\nThe gui for relocating GUI Elements and enabling or disabling features can be opened by typing §e/dg\nType §e/dg help §fto view full list of commands offered by dungeons guide!"; + + @Override + public void initGui() { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + this.buttonList.add(new GuiButton(0, sr.getScaledWidth()/2-100,sr.getScaledHeight()-70 ,"Continue")); + } + + @Override + protected void actionPerformed(GuiButton button) throws IOException { + super.actionPerformed(button); + if (button.id == 0) { + Minecraft.getMinecraft().displayGuiScreen(originalGUI); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawBackground(1); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + fontRenderer.drawString("§eWelcome To DungeonsGuide", (sr.getScaledWidth()-fontRenderer.getStringWidth("Welcome To DungeonsGuide"))/2,40,0xFFFF0000); + int tenth = sr.getScaledWidth() / 10; + Gui.drawRect(tenth, 70,sr.getScaledWidth()-tenth, sr.getScaledHeight()-80, 0xFF5B5B5B); + + String[] split = welcomeText.split("\n"); + for (int i = 0; i < split.length; i++) { + fontRenderer.drawString(split[i].replace("\t", " "), tenth + 2,i*fontRenderer.FONT_HEIGHT + 72, 0xFFFFFFFF); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + }; + } + + } + } + + + public void preinit(){ + + File configFile = new File(Main.getConfigDir(), "config.json"); + if (!configFile.exists()) { + Main.getConfigDir().mkdirs(); + firstTimeUsingDG = true; + } + + Config.f = configFile; + Minecraft.getMinecraft().getFramebuffer().enableStencil(); + + try { + List<IResourcePack> resourcePackList = ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "defaultResourcePacks", "aA", "field_110449_ao"); + resourcePackList.add(new DGTexturePack()); + Minecraft.getMinecraft().refreshResources(); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public SkyblockStatus getSkyblockStatus() { + return skyblockStatus; + } + + + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/Keybinds.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/Keybinds.java index 1235d29e..39f89834 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/Keybinds.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/Keybinds.java @@ -16,16 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide; +package kr.syeyoung.dungeonsguide.mod; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.util.ChatComponentText; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import org.lwjgl.input.Keyboard; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java index 7e2286b3..4cd4e3ee 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java @@ -16,55 +16,82 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide; +package kr.syeyoung.dungeonsguide.mod; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.commands.*; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonLeftEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.HypixelJoinedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.SkyblockJoinedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.SkyblockLeftEvent; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; -import net.minecraft.scoreboard.*; -import net.minecraftforge.client.ClientCommandHandler; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.relauncher.Side; -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import java.io.File; -import java.io.IOException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; import java.util.Collection; import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; public class SkyblockStatus { - @Getter - private boolean isOnSkyblock; - private boolean isOnDungeon; + boolean wasOnHypixel = false; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent ev) { + if (ev.side == Side.SERVER || ev.phase != TickEvent.Phase.START) return; + + SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); + boolean isOnDungeonPrev = isOnDungeon(); + boolean isOnSkyblockPrev = isOnSkyblock(); + skyblockStatus.updateStatus(); + + if (!wasOnHypixel && skyblockStatus.isOnHypixel()) { + MinecraftForge.EVENT_BUS.post(new HypixelJoinedEvent()); + } + wasOnHypixel = skyblockStatus.isOnHypixel(); + + if (isOnSkyblockPrev && !isOnSkyblock()) { + MinecraftForge.EVENT_BUS.post(new SkyblockLeftEvent()); + } else if (!isOnSkyblockPrev && isOnSkyblock()) { + MinecraftForge.EVENT_BUS.post(new SkyblockJoinedEvent()); + } + + if (isOnDungeonPrev && !isOnDungeon()) { + MinecraftForge.EVENT_BUS.post(new DungeonLeftEvent()); + } + + - public boolean isOnDungeon() { - return forceIsOnDungeon || isOnDungeon; } - @Getter @Setter - private boolean forceIsOnDungeon; - @Getter - @Setter - private DungeonContext context; + public static boolean isOnSkyblock(){ + SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); + + return skyblockStatus != null && skyblockStatus.isOnSkyblock; + } + + public static boolean isOnDungeon() { + SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); + + + + return skyblockStatus != null && (skyblockStatus.forceIsOnDungeon || skyblockStatus.isOnDungeon); + } - @Getter - @Setter - private int percentage; + + private boolean isOnSkyblock; + private boolean isOnDungeon; @Getter @Setter - private String dungeonName; + private boolean forceIsOnDungeon; public boolean isOnHypixel() { Minecraft mc = Minecraft.getMinecraft(); @@ -106,18 +133,23 @@ public class SkyblockStatus { Collection<Score> scores = scoreboard.getSortedScores(scoreObjective); boolean foundDungeon = false; - for (Score sc:scores) { + for (Score sc : scores) { ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(sc.getPlayerName()); String strippedLine = TextUtils.keepScoreboardCharacters(TextUtils.stripColor(ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()))).trim(); if (strippedLine.contains("Cleared: ")) { foundDungeon = true; - percentage = Integer.parseInt(strippedLine.substring(9).split(" ")[0]); + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if(context != null){ + context.setPercentage(Integer.parseInt(strippedLine.substring(9).split(" ")[0])); + } } if (ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()).startsWith(" §7⏣")) { - dungeonName = strippedLine.trim(); + DungeonContext.setDungeonName(strippedLine.trim()); } } isOnDungeon = foundDungeon; } + } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/chat/ChatProcessResult.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessResult.java index 94bafa95..bacd7c4b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/chat/ChatProcessResult.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessResult.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.chat; +package kr.syeyoung.dungeonsguide.mod.chat; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/chat/ChatProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java index 5fc666e2..b65e64aa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/chat/ChatProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.chat; +package kr.syeyoung.dungeonsguide.mod.chat; -import kr.syeyoung.dungeonsguide.DungeonsGuide; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiNewChat; import net.minecraft.util.ChatComponentText; @@ -33,14 +32,16 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.simple.SimpleLogger; -import java.util.*; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.CopyOnWriteArrayList; public class ChatProcessor { public static final ChatProcessor INSTANCE = new ChatProcessor(); - private static final Logger logger = LogManager.getLogger(); + private static final Logger logger = LogManager.getLogger("DG-ChatProcessor"); private ChatProcessor() { Logger l = LogManager.getLogger(GuiNewChat.class); if (l instanceof SimpleLogger) { @@ -53,6 +54,7 @@ public class ChatProcessor { private Queue<ChatSubscriber> chatSubscriberQueue = new ConcurrentLinkedQueue<>(); private Queue<Tuple<String, Runnable>> chatQueue = new ConcurrentLinkedQueue<>(); + public void subscribe(ChatSubscriber chatSubscribed) { chatSubscriberQueue.add(chatSubscribed); } @@ -74,8 +76,9 @@ public class ChatProcessor { if (tuple.getSecond() != null) tuple.getSecond().run(); minimumNext = System.currentTimeMillis() + 200; - DungeonsGuide.sendDebugChat(new ChatComponentText("Sending " + tuple.getFirst() + " Secretly")); + ChatTransmitter.sendDebugChat(new ChatComponentText("Sending " + tuple.getFirst() + " Secretly")); } + } } catch (Throwable e) { e.printStackTrace(); @@ -87,7 +90,7 @@ public class ChatProcessor { public void onMessage(ClientChatReceivedEvent chatReceivedEvent) { if (chatReceivedEvent.type == 2) return; String txt = chatReceivedEvent.message.getFormattedText(); - logger.log(Level.INFO, "[CHAT] "+txt); + logger.info("[CHAT] {}", txt); int processed = 0; int listenened = 0; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/chat/ChatSubscriber.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatSubscriber.java index 72879eb0..fa7e70af 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/chat/ChatSubscriber.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatSubscriber.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.chat; +package kr.syeyoung.dungeonsguide.mod.chat; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatTransmitter.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatTransmitter.java new file mode 100644 index 00000000..bfdbd5db --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatTransmitter.java @@ -0,0 +1,69 @@ +package kr.syeyoung.dungeonsguide.mod.chat; + +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; + +public class ChatTransmitter { + + public static final String PREFIX = "§eDungeons Guide §7:: "; + public static String prefix = "§eDungeons Guide §7:: "; + + public ChatTransmitter() { + MinecraftForge.EVENT_BUS.register(this); + } + + static Queue<ChatComponentText> receiveQueue = new ConcurrentLinkedQueue<>(); + + public static void addToQueue(String chat, boolean noDupe) { + addToQueue(new ChatComponentText(chat), noDupe); + } + + public static void addToQueue(ChatComponentText chat) { + addToQueue(chat, false); + } + public static void addToQueue(ChatComponentText chat, boolean noDupe) { + if(noDupe && receiveQueue.stream().anyMatch(a -> a.equals(chat))) return; + receiveQueue.add(chat); + } + + public static void addToQueue(String s) { + addToQueue(s, false); + } + + public static void sendDebugChat(IChatComponent iChatComponent) { + if(FeatureRegistry.DEBUG == null) return; + if (FeatureRegistry.DEBUG.isEnabled()) + addToQueue((ChatComponentText) iChatComponent); + } + + public static void sendDebugChat(String text) { + sendDebugChat(new ChatComponentText(text)); + } + + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent clientTickEvent) { + if(clientTickEvent.phase != TickEvent.Phase.START && Minecraft.getMinecraft().thePlayer == null) return; + + if (!receiveQueue.isEmpty()) { + ClientChatReceivedEvent event = new ClientChatReceivedEvent((byte) 1, receiveQueue.poll()); + MinecraftForge.EVENT_BUS.post(event); + if (!event.isCanceled()) { + Minecraft.getMinecraft().thePlayer.addChatMessage(event.message); + } + } + + + } + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java index 95850fdc..b3f8dd19 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java @@ -1,70 +1,45 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.commands; - -import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.chat.PartyContext; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.rpc.RichPresenceManager; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfigV2; -import kr.syeyoung.dungeonsguide.config.guiconfig.NestedCategory; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.MapProcessor; +package kr.syeyoung.dungeonsguide.mod.commands; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.Main; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.NestedCategory; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.MapProcessor; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProvider; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProviderRegistry; -import kr.syeyoung.dungeonsguide.dungeon.events.DungeonEventHolder; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProvider; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProviderRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventHolder; import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; -import kr.syeyoung.dungeonsguide.events.DungeonLeftEvent; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.ApiFetcher; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessor; -import kr.syeyoung.dungeonsguide.stomp.*; -import kr.syeyoung.dungeonsguide.utils.AhUtils; -import kr.syeyoung.dungeonsguide.utils.MapUtils; -import kr.syeyoung.dungeonsguide.utils.ShortUtils; -import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonRoomEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoomInfoRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessor; +import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonLeftEvent; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.party.PartyContext; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.utils.*; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.*; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.Tuple; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import org.json.JSONObject; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; @@ -72,95 +47,103 @@ import javax.crypto.NoSuchPaddingException; import javax.vecmath.Vector2d; import java.awt.*; import java.io.*; +import java.nio.file.Files; import java.security.*; import java.security.cert.CertificateException; -import java.text.SimpleDateFormat; -import java.util.*; import java.util.List; +import java.util.*; import java.util.regex.Pattern; -public class CommandDungeonsGuide extends CommandBase { +public class CommandDgDebug extends CommandBase { @Override public String getCommandName() { - return "dg"; + return "dgdebug"; } @Override public String getCommandUsage(ICommandSender sender) { - return "dg"; + return "dgdebug"; } @Override - public void processCommand(ICommandSender sender, String[] args) { - if (args.length == 0) { - openConfig = true; - } else if (args[0].equalsIgnoreCase("saverooms")) { - DungeonRoomInfoRegistry.saveAll(DungeonsGuide.getDungeonsGuide().getConfigDir()); + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length == 0) return; + String arg = args[0].toLowerCase(); + + + if ("scoreboard".equals(arg)) { + ScoreBoardUtils.forEachLine(l -> { + ChatTransmitter.addToQueue("LINE: " + l, false); + }); + } else if ("scoreboardclean".equals(arg)) { + ScoreBoardUtils.forEachLineClean(l -> { + ChatTransmitter.addToQueue("LINE: " + l, false); + }); + } else if ("title".equals(arg)) { + if (args.length == 2) { + System.out.println("Displayuing title:" + args[1]); + TitleRender.displayTitle(args[1], "", 10, 40, 20); + } + } else if ("mockdungeonstart".equals(arg)) { + if (!Minecraft.getMinecraft().isSingleplayer()) { + ChatTransmitter.addToQueue("This only works in singlepauer", false); + return; + } + + if (args.length == 2) { + int time = Integer.parseInt(args[1]); + ChatTransmitter.addToQueue("§r§aDungeon starts in " + time + " seconds.§r", false); + return; + } + + + (new Thread(() -> { + try { + ChatTransmitter.addToQueue("§r§aDungeon starts in 15 seconds.§r", false); + Thread.sleep(6000); + ChatTransmitter.addToQueue("§r§aDungeon starts in 10 seconds.§r", false); + Thread.sleep(700); + ChatTransmitter.addToQueue("§r§aDungeon starts in 5 seconds.§r", false); + Thread.sleep(1000); + ChatTransmitter.addToQueue("§r§aDungeon starts in 4 seconds.§r", false); + Thread.sleep(1000); + ChatTransmitter.addToQueue("§r§aDungeon starts in 3 seconds.§r", false); + Thread.sleep(1000); + ChatTransmitter.addToQueue("§r§aDungeon starts in 2 seconds.§r", false); + Thread.sleep(1000); + ChatTransmitter.addToQueue("§r§aDungeon starts in 1 seconds.§r", false); + } catch (InterruptedException ignored) { + } + })).start(); + } else if ("saverooms".equals(arg)) { + DungeonRoomInfoRegistry.saveAll(Main.getConfigDir()); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully saved user generated roomdata")); - } else if (args[0].equalsIgnoreCase("loadrooms")) { + } else if ("loadrooms".equals(arg)) { try { - DungeonRoomInfoRegistry.loadAll(DungeonsGuide.getDungeonsGuide().getConfigDir()); + DungeonRoomInfoRegistry.loadAll(Main.getConfigDir()); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully loaded roomdatas")); return; - } catch (BadPaddingException e) { - e.printStackTrace(); - } catch (InvalidAlgorithmParameterException e) { - e.printStackTrace(); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } catch (IllegalBlockSizeException e) { - e.printStackTrace(); - } catch (NoSuchPaddingException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { + } catch (BadPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | + NoSuchAlgorithmException | IOException | IllegalBlockSizeException | + NoSuchPaddingException e) { e.printStackTrace(); } sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cAn error has occurred while loading roomdata")); - } else if (args[0].equalsIgnoreCase("reloadah")) { + } else if ("reloadah".equals(arg)) { try { AhUtils.loadAuctions(); - } catch (CertificateException e) { - e.printStackTrace(); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (InvalidAlgorithmParameterException e) { - e.printStackTrace(); - } catch (NoSuchPaddingException e) { - e.printStackTrace(); - } catch (BadPaddingException e) { - e.printStackTrace(); - } catch (KeyStoreException e) { - e.printStackTrace(); - } catch (IllegalBlockSizeException e) { - e.printStackTrace(); - } catch (KeyManagementException e) { + } catch (CertificateException | NoSuchAlgorithmException | InvalidKeyException | + InvalidAlgorithmParameterException | NoSuchPaddingException | BadPaddingException | + KeyStoreException | IllegalBlockSizeException | KeyManagementException e) { e.printStackTrace(); } sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fReloaded Ah data")); - } else if (args[0].equalsIgnoreCase("brand")) { + } else if ("brand".equals(arg)) { String serverBrand = Minecraft.getMinecraft().thePlayer.getClientBrand(); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + serverBrand)); - } else if (args[0].equalsIgnoreCase("reparty")) { - if (!DungeonsGuide.getDungeonsGuide().getCommandReparty().requestReparty(false)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCurrently Repartying")); - } - } else if (args[0].equalsIgnoreCase("gui")) { - openConfig = true; - } else if (args[0].equalsIgnoreCase("info")) { - JsonObject obj = DungeonsGuide.getDungeonsGuide().getAuthenticator().getJwtPayload(DungeonsGuide.getDungeonsGuide().getAuthenticator().getToken()); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fCurrent Plan§7: §e" + obj.get("plan").getAsString())); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fBound to§7: §e" + obj.get("nickname").getAsString())); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fBound uuid§7: §e" + obj.get("uuid").getAsString())); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSession Expire§7: §e" + sdf.format(new Date(obj.get("exp").getAsLong() * 1000)))); - } else if (args[0].equalsIgnoreCase("pathfind")) { + } else if ("pathfind".equals(arg)) { try { - DungeonContext context = DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; if (thePlayer == null) return; if (context.getBossfightProcessor() != null) context.getBossfightProcessor().tick(); @@ -172,10 +155,10 @@ public class CommandDungeonsGuide extends CommandBase { } catch (Throwable t) { t.printStackTrace(); } - } else if (args[0].equals("process") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) { - File root = DungeonsGuide.getDungeonsGuide().getConfigDir(); - File dir = new File(root, "processorinput"); - File outsecret = new File(root, "processoroutsecret"); + } else if ("process".equals(arg)) { + File fileRoot = Main.getConfigDir(); + File dir = new File(fileRoot, "processorinput"); + File outsecret = new File(fileRoot, "processoroutsecret"); for (File f : dir.listFiles()) { if (!f.getName().endsWith(".roomdata")) continue; try { @@ -195,9 +178,9 @@ public class CommandDungeonsGuide extends CommandBase { e.printStackTrace(); } } - } else if (args[0].equals("check") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) { - File root = DungeonsGuide.getDungeonsGuide().getConfigDir(); - for (File f : root.listFiles()) { + } else if ("check".equals(arg)) { + File fileroot = Main.getConfigDir(); + for (File f : fileroot.listFiles()) { if (!f.getName().endsWith(".roomdata")) continue; try { InputStream fis = new FileInputStream(f); @@ -256,107 +239,28 @@ public class CommandDungeonsGuide extends CommandBase { e.printStackTrace(); } } - } else if (args[0].equals("reloaddungeon") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) { + } else if ("reloaddungeon".equals(arg)) { try { MinecraftForge.EVENT_BUS.post(new DungeonLeftEvent()); - DungeonsGuide.getDungeonsGuide().getSkyblockStatus().setContext(null); + + DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(null); MapUtils.clearMap(); } catch (Throwable t) { t.printStackTrace(); } - } else if (args[0].equalsIgnoreCase("pvall")) { - PartyManager.INSTANCE.requestPartyList((context) -> { - if (context == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cNot in Party")); - return; - } - FeatureViewPlayerStatsOnJoin.processPartyMembers(context); - }); -// } else if (args[0].equals("fixschematic")) { -// File root = new File(e.getDungeonsGuide().getConfigDir(), "schematics"); -// Method method = null; -// try { -// method = NBTTagCompound.class.getDeclaredMethod("write", DataOutput.class); -// method.setAccessible(true); -// } catch (NoSuchMethodException e) { -// e.printStackTrace(); -// return; -// } -// for (File f : root.listFiles()) { -// try { -// NBTTagCompound nbtTagCompound = CompressedStreamTools.readCompressed(new FileInputStream(f)); -// if (nbtTagCompound.getKeySet().isEmpty()) { -// System.out.println("ah"); -// return; -// } -// nbtTagCompound.setString("Materials","Alpha"); -// FileOutputStream fos = new FileOutputStream(f); -// DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(fos))); -// -// try -// { -// dataoutputstream.writeByte(nbtTagCompound.getId()); -// -// dataoutputstream.writeUTF("Schematic"); -// method.invoke(nbtTagCompound, dataoutputstream); -// } -// finally -// { -// dataoutputstream.close(); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } - } else if (args[0].equalsIgnoreCase("asktojoin") || args[0].equalsIgnoreCase("atj")) { - if (RichPresenceManager.INSTANCE.getLastSetupCode() == -9999) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDiscord GameSDK has been disabled, or it failed to load!")); - return; - } - if (!PartyManager.INSTANCE.canInvite()) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cYou don't have perms in the party to invite people!")); - } else { - PartyManager.INSTANCE.toggleAllowAskToJoin(); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fToggled Ask to join to " + (PartyManager.INSTANCE.getAskToJoinSecret() != null ? "§eon" : "§coff"))); - } - - if (!FeatureRegistry.DISCORD_RICHPRESENCE.isEnabled()) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDiscord Rich Presence is disabled! Enable at /dg -> Discord ")); - } - if (!FeatureRegistry.DISCORD_ASKTOJOIN.isEnabled()) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDiscord Invite Viewer is disabled! Enable at /dg -> Discord ")); // how - } - } else if (args[0].equalsIgnoreCase("partymax") || args[0].equalsIgnoreCase("pm")) { - if (args.length == 1) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fCurrent party max is §e" + PartyManager.INSTANCE.getMaxParty())); - } else if (args.length == 2) { - try { - int partyMax = Integer.parseInt(args[1]); - if (partyMax < 2) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cparty max can't be smaller than 2")); - return; - } - - PartyManager.INSTANCE.setMaxParty(partyMax); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully set partymax to §e" + PartyManager.INSTANCE.getMaxParty())); - } catch (Exception e) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §c" + args[1] + " is not valid number.")); - return; - } - } - } else if (args[0].equals("partyid")) { + } else if ("partyid".equals(arg)) { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fInternal Party id: " + Optional.ofNullable(PartyManager.INSTANCE.getPartyContext()).map(PartyContext::getPartyID).orElse(null))); - } else if (args[0].equalsIgnoreCase("loc")) { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fYou're in " + DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName())); - } else if (args[0].equalsIgnoreCase("saverun")) { + } else if ("loc".equals(arg)) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fYou're in " + DungeonContext.getDungeonName())); + } else if ("saverun".equals(arg)) { try { - File f = DungeonsGuide.getDungeonsGuide().getConfigDir(); + File f = Main.getConfigDir(); File runDir = new File(f, "dungeonruns"); runDir.mkdirs(); File runFile = new File(runDir, UUID.randomUUID() + ".dgrun"); - DungeonContext dungeonContext = DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext(); + DungeonContext dungeonContext = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (dungeonContext == null) { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't find dungeon to save!")); return; @@ -367,7 +271,7 @@ public class CommandDungeonsGuide extends CommandBase { dungeonEventHolder.setEventDataList(dungeonContext.getEvents()); - ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(runFile)); + ObjectOutputStream oos = new ObjectOutputStream(Files.newOutputStream(runFile.toPath())); oos.writeObject(dungeonEventHolder); oos.flush(); oos.close(); @@ -376,47 +280,13 @@ public class CommandDungeonsGuide extends CommandBase { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cAn error occured while writing rundata " + e.getMessage())); e.printStackTrace(); } - } else if (args[0].equals("pv")) { - try { - ApiFetcher.fetchUUIDAsync(args[1]) - .thenAccept(a -> { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + args[1] + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new FeatureViewPlayerStatsOnJoin.HoverEventRenderPlayer(a.orElse(null)))))); - }); - } catch (Exception e) { - e.printStackTrace(); - } - } else if (args[0].equals("purge")) { - ApiFetcher.purgeCache(); - CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); - cosmeticsManager.requestPerms(); - cosmeticsManager.requestCosmeticsList(); - cosmeticsManager.requestActiveCosmetics(); - StaticResourceCache.INSTANCE.purgeCache(); - FeatureRegistry.DISCORD_ASKTOJOIN.imageMap.clear(); - FeatureRegistry.DISCORD_ASKTOJOIN.futureMap.clear(); - - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully purged API Cache!")); - } else if (args[0].equals("pbroadcast")) { - try { - String[] payload = new String[args.length - 1]; - System.arraycopy(args, 1, payload, 0, payload.length); - String actualPayload = String.join(" ", payload).replace("$C$", "§"); - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().header("destination", "/app/party.broadcast").payload( - new JSONObject().put("partyID", PartyManager.INSTANCE.getPartyContext().getPartyID()) - .put("payload", actualPayload).toString() - )); - } catch (Exception e) { - e.printStackTrace(); - } - } else if (args[0].equals("requeststaticresource")) { + } else if ("requeststaticresource".equals(arg)) { UUID uid = UUID.fromString(args[1]); StaticResourceCache.INSTANCE.getResource(uid).thenAccept(a -> { sender.addChatMessage(new ChatComponentText(a.getResourceID() + ": " + a.getValue() + ": " + a.isExists())); }); - } else if (args[0].equals("createFakeRoom") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) { - - // load schematic - File f = new File(DungeonsGuide.getDungeonsGuide().getConfigDir(), "schematics/new roonm-b2df250c-4af2-4201-963c-0ee1cb6bd3de-5efb1f0c-c05f-4064-bde7-cad0874fdf39.schematic"); + } else if ("createfakeroom".equals(arg)) {// load schematic + File f = new File(Main.getConfigDir(), "schematics/new roonm-b2df250c-4af2-4201-963c-0ee1cb6bd3de-5efb1f0c-c05f-4064-bde7-cad0874fdf39.schematic"); NBTTagCompound compound; try { compound = CompressedStreamTools.readCompressed(new FileInputStream(f)); @@ -470,15 +340,14 @@ public class CommandDungeonsGuide extends CommandBase { return 0; } }); - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - skyblockStatus.setDungeonName("TEST DG"); + DungeonContext.setDungeonName("TEST DG"); DungeonContext fakeContext = new DungeonContext(Minecraft.getMinecraft().theWorld); - skyblockStatus.setContext(fakeContext); - skyblockStatus.setForceIsOnDungeon(true); + DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(fakeContext); + DungeonsGuide.getDungeonsGuide().getSkyblockStatus().setForceIsOnDungeon(true); MapProcessor mapProcessor = fakeContext.getMapProcessor(); mapProcessor.setUnitRoomDimension(new Dimension(16, 16)); mapProcessor.setBugged(false); - mapProcessor.setDoorDimension(new Dimension(4, 4)); + mapProcessor.setDoorDimensions(new Dimension(4, 4)); mapProcessor.setTopLeftMapPoint(new Point(0, 0)); fakeContext.setDungeonMin(new BlockPos(0, 70, 0)); @@ -491,14 +360,15 @@ public class CommandDungeonsGuide extends CommandBase { EditingContext.createEditingContext(dungeonRoom); EditingContext.getEditingContext().openGui(new GuiDungeonRoomEdit(dungeonRoom)); - } else if (args[0].equals("CloseContext")) { + } else if ("closecontext".equals(arg)) { DungeonsGuide.getDungeonsGuide().getSkyblockStatus().setForceIsOnDungeon(false); - DungeonsGuide.getDungeonsGuide().getSkyblockStatus().setContext(null); - } else if (args[0].equals("dumpsettings")) { - NestedCategory root = new NestedCategory("ROOT"); + + DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(null); + } else if ("dumpsettings".equals(arg)) { + NestedCategory nestedCategory = new NestedCategory("ROOT"); for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { String category = abstractFeature.getCategory(); - NestedCategory currentRoot = root; + NestedCategory currentRoot = nestedCategory; for (String s : category.split("\\.")) { NestedCategory finalCurrentRoot = currentRoot; if (currentRoot.children().containsKey(s)) @@ -513,7 +383,7 @@ public class CommandDungeonsGuide extends CommandBase { StringBuilder stringBuilder2 = new StringBuilder(); Stack<Tuple<NestedCategory, Integer>> stak = new Stack<>(); - stak.push(new Tuple<>(root, 0)); + stak.push(new Tuple<>(nestedCategory, 0)); Set<NestedCategory> discovered = new HashSet<>(); while (!stak.isEmpty()) { Tuple<NestedCategory, Integer> n = stak.pop(); @@ -539,11 +409,11 @@ public class CommandDungeonsGuide extends CommandBase { } System.out.println(stringBuilder.toString()); System.out.println(stringBuilder2.toString()); - } else if (args[0].equals("readMap")) { + } else if ("readmap".equals(arg)) { try { int fromX = Integer.parseInt(args[1]); int fromY = Integer.parseInt(args[2]); - sender.addChatMessage(new ChatComponentText(MapUtils.readDigit(MapUtils.getColors(), fromX, fromY)+"-")); + sender.addChatMessage(new ChatComponentText(MapUtils.readDigit(MapUtils.getColors(), fromX, fromY) + "-")); // int cntY = Integer.parseInt(args[3]); // int target = Integer.parseInt(args[4]); // StringBuilder sb = new StringBuilder("{"); @@ -563,37 +433,15 @@ public class CommandDungeonsGuide extends CommandBase { e.printStackTrace(); } } else { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg gui §7-§fOpens configuration gui")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg help §7-§fShows command help")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg saverooms §7-§f Saves usergenerated dungeon roomdata.")); + sender.addChatMessage(new ChatComponentText("ain't gonna find much anything here")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg loadrooms §7-§f Reloads dungeon roomdata.")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg reloadah §7-§f Reloads price data from server.")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg brand §7-§f View server brand.")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg reparty §7-§f Reparty.")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg info §7-§f View Current DG User info.")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg asktojoin or /dg atj §7-§f Toggle ask to join §cRequires Discord Rich Presence enabled. (/dg -> Advanced)")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg partymax [number] or /dg pm [number] §7-§f Sets partymax §7(maximum amount people in party, for discord rpc)")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg pv [ign] §7-§f Profile Viewer")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg pvall §7-§f Profile Viewer For all people on party")); - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg purge §7-§f Purge api cache.")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg saverun §7-§f Save run to be sent to developer.")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg saverooms §7-§f Saves usergenerated dungeon roomdata.")); } } - private boolean openConfig = false; - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent e) { - try { - if (openConfig && e.phase == TickEvent.Phase.START ) { - openConfig = false; - Minecraft.getMinecraft().displayGuiScreen(new GuiConfigV2()); - } - } catch (Throwable t) { - t.printStackTrace(); - } - } @Override public int getRequiredPermissionLevel() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java new file mode 100644 index 00000000..9b9811cd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java @@ -0,0 +1,172 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.commands; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.GuiConfigV2; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.RichPresenceManager; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.ApiFetcher; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.stomp.StompManager; +import kr.syeyoung.dungeonsguide.mod.stomp.StompPayload; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.json.JSONObject; + +public class CommandDungeonsGuide extends CommandBase { + private boolean openConfig = false; + + @Override + public String getCommandName() { + return "dg"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "dg"; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (args.length == 0) { + openConfig = true; + } else if (args[0].equalsIgnoreCase("reparty")) { + if (!DungeonsGuide.getDungeonsGuide().getCommandReparty().requestReparty(false)) { + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cCurrently Repartying")); + } + } else if (args[0].equalsIgnoreCase("gui")) { + openConfig = true; + } else if (args[0].equalsIgnoreCase("pvall")) { + PartyManager.INSTANCE.requestPartyList((context) -> { + if (context == null) { + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cNot in Party")); + return; + } + FeatureViewPlayerStatsOnJoin.processPartyMembers(context); + }); + } else if (args[0].equalsIgnoreCase("asktojoin") || args[0].equalsIgnoreCase("atj")) { + if (RichPresenceManager.INSTANCE.getLastSetupCode() == -9999) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDiscord GameSDK has been disabled, or it failed to load!")); + return; + } + if (!PartyManager.INSTANCE.canInvite()) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cYou don't have perms in the party to invite people!")); + } else { + PartyManager.INSTANCE.toggleAllowAskToJoin(); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fToggled Ask to join to " + (PartyManager.INSTANCE.getAskToJoinSecret() != null ? "§eon" : "§coff"))); + } + + if (!FeatureRegistry.DISCORD_RICHPRESENCE.isEnabled()) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDiscord Rich Presence is disabled! Enable at /dg -> Discord ")); + } + if (!FeatureRegistry.DISCORD_ASKTOJOIN.isEnabled()) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDiscord Invite Viewer is disabled! Enable at /dg -> Discord ")); // how + } + } else if (args[0].equals("pv")) { + try { + ApiFetcher.fetchUUIDAsync(args[1]) + .thenAccept(a -> { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + args[1] + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new FeatureViewPlayerStatsOnJoin.HoverEventRenderPlayer(a.orElse(null)))))); + }); + } catch (Exception e) { + e.printStackTrace(); + } + } else if (args[0].equals("purge")) { + ApiFetcher.purgeCache(); + CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); + cosmeticsManager.requestPerms(); + cosmeticsManager.requestCosmeticsList(); + cosmeticsManager.requestActiveCosmetics(); + StaticResourceCache.INSTANCE.purgeCache(); + FeatureRegistry.DISCORD_ASKTOJOIN.imageMap.clear(); + FeatureRegistry.DISCORD_ASKTOJOIN.futureMap.clear(); + + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully purged API Cache!")); + } else if (args[0].equals("pbroadcast")) { + try { + String[] payload = new String[args.length - 1]; + System.arraycopy(args, 1, payload, 0, payload.length); + String actualPayload = String.join(" ", payload).replace("$C$", "§"); + StompManager.getInstance().send(new StompPayload().header("destination", "/app/party.broadcast").payload( + new JSONObject().put("partyID", PartyManager.INSTANCE.getPartyContext().getPartyID()) + .put("payload", actualPayload).toString() + )); + } catch (Exception e) { + e.printStackTrace(); + } + + + } else if (args[0].equals("partymax") || args[0].equals("pm")) { + if (args.length == 1) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fCurrent party max is §e" + PartyManager.INSTANCE.getMaxParty())); + } else if (args.length == 2) { + try { + int partyMax = Integer.parseInt(args[1]); + if (partyMax < 2) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cparty max can't be smaller than 2")); + return; + } + + PartyManager.INSTANCE.setMaxParty(partyMax); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully set partymax to §e" + PartyManager.INSTANCE.getMaxParty())); + } catch (Exception e) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §c" + args[1] + " is not valid number.")); + } + } + } else { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg gui §7-§fOpens configuration gui")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg help §7-§fShows command help")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg reloadah §7-§f Reloads price data from server.")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg reparty §7-§f Reparty.")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg asktojoin or /dg atj §7-§f Toggle ask to join §cRequires Discord Rich Presence enabled. (/dg -> Advanced)")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg partymax [number] or /dg pm [number] §7-§f Sets partymax §7(maximum amount people in party, for discord rpc)")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg pv [ign] §7-§f Profile Viewer")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg pvall §7-§f Profile Viewer For all people on party")); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg purge §7-§f Purge api cache.")); + } + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent e) { + try { + if (openConfig && e.phase == TickEvent.Phase.START) { + openConfig = false; + Minecraft.getMinecraft().displayGuiScreen(new GuiConfigV2()); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandReparty.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandReparty.java index 8df85529..65eccb3b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandReparty.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandReparty.java @@ -16,23 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.commands; +package kr.syeyoung.dungeonsguide.mod.commands; -import kr.syeyoung.dungeonsguide.chat.ChatProcessor; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import net.minecraft.client.Minecraft; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; -import net.minecraftforge.client.event.ClientChatReceivedEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; import java.util.stream.Collectors; public class CommandReparty extends CommandBase { @@ -55,7 +49,7 @@ public class CommandReparty extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) { if (!requestReparty(false)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCurrently Repartying")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cCurrently Repartying")); } } @@ -71,30 +65,30 @@ public class CommandReparty extends CommandBase { PartyManager.INSTANCE.requestPartyList(pc -> { if (pc == null) { if (!noerror) - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cNot in Party")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cNot in Party")); reparting = false; return; } if (!pc.hasLeader(Minecraft.getMinecraft().getSession().getUsername())) { if (!noerror) - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cYou're not leader")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cYou're not leader")); reparting = false; return; } if (pc.isSelfSolo()) { if (!noerror) - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cYou can not reparty yourself")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cYou can not reparty yourself")); reparting = false; return; } String members = pc.getPartyRawMembers().stream().filter(a -> !a.equalsIgnoreCase(Minecraft.getMinecraft().getSession().getUsername())).collect(Collectors.joining(" ")); String command = "/p invite "+members; - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eDisbanding Party...")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eDisbanding Party...")); ChatProcessor.INSTANCE.addToChatQueue("/p disband", () -> { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eRunning invite command §f"+command)); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eRunning invite command §f"+command)); ChatProcessor.INSTANCE.addToChatQueue(command, () -> { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eSuccessfully repartied!§f")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eSuccessfully repartied!§f")); reparting = false; }, false); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/Config.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/Config.java index f8d60424..0e1bf7fd 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/Config.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/Config.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config; +package kr.syeyoung.dungeonsguide.mod.config; import com.google.gson.Gson; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import java.io.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/ConfigPanelCreator.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/ConfigPanelCreator.java index d02680bf..da3974a3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/ConfigPanelCreator.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/ConfigPanelCreator.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; import com.google.common.base.Function; import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import org.jetbrains.annotations.Nullable; import java.util.HashMap; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfigV2.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/GuiConfigV2.java index d1888283..0f6be522 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfigV2.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/GuiConfigV2.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; -import kr.syeyoung.dungeonsguide.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.util.MathHelper; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MCategory.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MCategory.java index 77111fe7..c4561c09 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MCategory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MCategory.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MCategoryElement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MCategoryElement.java index 22934fca..74f5f352 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MCategoryElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MCategoryElement.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MFeature.java index 49f637a5..070f4fce 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MFeature.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; - -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MToggleButton; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; + +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MToggleButton; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeatureEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MFeatureEdit.java index f2ee35bc..87e1b6f1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeatureEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MFeatureEdit.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MList; -import kr.syeyoung.dungeonsguide.gui.elements.MModalConfirmation; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MList; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MModalConfirmation; import java.awt.*; import java.util.HashMap; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MNotFound.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MNotFound.java index ef885487..b63c4e90 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MNotFound.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MNotFound.java @@ -16,13 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import org.lwjgl.opengl.GL11; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MPanelCategory.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MPanelCategory.java index e2388c60..435940d3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MPanelCategory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MPanelCategory.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MList; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MList; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameterEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MParameterEdit.java index 6f791bcf..e73e851b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameterEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/MParameterEdit.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; - -import com.google.common.base.Predicates; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/NestedCategory.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/NestedCategory.java index a4812fb7..28a3d4d1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/NestedCategory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/NestedCategory.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import lombok.experimental.Accessors; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/RootConfigPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java index 1827d766..d4d7dcf9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/RootConfigPanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java @@ -16,15 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig; import com.google.common.base.Function; -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.auth.AuthManager; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; @@ -263,6 +264,11 @@ public class RootConfigPanel extends MPanelScaledGUI { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + + if(AuthManager.getInstance().getToken() == null) { + fr.drawString("ERROR CONNECTING TO DG, YOUR COSMETICS ARE NOT VISIBLE",(effectiveDim.width - fr.getStringWidth("ERROR CONNECTING TO DG, YOUR COSMETICS ARE NOT VISIBLE"))/2, (10 - fr.FONT_HEIGHT)/2, 0xFFFF0000); + } + fr.drawString("DungeonsGuide By syeyoung", (effectiveDim.width - fr.getStringWidth("DungeonsGuide By syeyoung"))/2, (25 - fr.FONT_HEIGHT)/2, 0xFF02EE67); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/GuiGuiLocationConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java index 48c046c3..0b4193da 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/GuiGuiLocationConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig.location; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig.location; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.gui.MGui; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/Marker.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java index 7a0b9c58..10683425 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/Marker.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig.location; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig.location; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/PanelDelegate.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java index d34eb6c1..3c03fb73 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/PanelDelegate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java @@ -16,19 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig.location; - -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.config.guiconfig.location.Marker; -import kr.syeyoung.dungeonsguide.config.types.GUIRectangle; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MPopupMenu; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +package kr.syeyoung.dungeonsguide.mod.config.guiconfig.location; + +import kr.syeyoung.dungeonsguide.mod.config.types.GUIRectangle; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MPopupMenu; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltip; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java index c9f464df..3b5f3d36 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/GUIRectangle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/GUIRectangle.java index 1c129d2e..cf43fbfb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/GUIRectangle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/GUIRectangle.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCAColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCAColor.java index 33748a8b..dfc2d461 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCAColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCAColor.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import java.awt.*; - public class TCAColor implements TypeConverter<AColor> { @Override public String getTypeString() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCBoolean.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCBoolean.java index 15a26d0f..f973f495 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCBoolean.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCBoolean.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCColor.java index 6014b122..2544a4f3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCColor.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCFloat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java index 0890f350..2f2aa72f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCFloat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCGUIRectangle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCGUIRectangle.java index 8880a628..8d34b013 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCGUIRectangle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCGUIRectangle.java @@ -16,13 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import java.awt.*; - public class TCGUIRectangle implements TypeConverter<GUIRectangle> { @Override public String getTypeString() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCInteger.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCInteger.java index 2a066921..e895345d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCInteger.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCInteger.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCKeybind.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCKeybind.java index 4ae89395..5b3bb09b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCKeybind.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCKeybind.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCRectangle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCRectangle.java index ba778872..37736d44 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCRectangle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCRectangle.java @@ -16,12 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import org.w3c.dom.css.Rect; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCString.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCString.java index a90bedc6..b2f9dab4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCString.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCString.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCStringList.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCStringList.java index 0a3e6217..90d78d2a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCStringList.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCStringList.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,7 +24,6 @@ import com.google.gson.JsonPrimitive; import java.util.ArrayList; import java.util.List; -import java.util.stream.Stream; public class TCStringList implements TypeConverter<List<String>> { @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCTextStyle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCTextStyle.java index d27b311e..78f03ae0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCTextStyle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCTextStyle.java @@ -16,14 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; - -import java.util.List; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; public class TCTextStyle implements TypeConverter<TextStyle> { @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCTextStyleList.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCTextStyleList.java index e9721ab7..50455dd2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TCTextStyleList.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCTextStyleList.java @@ -16,12 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonArray; import com.google.gson.JsonElement; -import com.google.gson.JsonPrimitive; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TypeConverter.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TypeConverter.java index b1c3ed5c..eb4c7a27 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TypeConverter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TypeConverter.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; +package kr.syeyoung.dungeonsguide.mod.config.types; import com.google.gson.JsonElement; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TypeConverterRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TypeConverterRegistry.java index abffd34a..f635d6ad 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/TypeConverterRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TypeConverterRegistry.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.types; - -import kr.syeyoung.dungeonsguide.roomedit.Parameter; +package kr.syeyoung.dungeonsguide.mod.config.types; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/ActiveCosmetic.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/ActiveCosmetic.java index f00ecf06..b71a003c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/ActiveCosmetic.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/ActiveCosmetic.java @@ -1,4 +1,4 @@ -package kr.syeyoung.dungeonsguide.cosmetics; +package kr.syeyoung.dungeonsguide.mod.cosmetics; import lombok.Data; import java.util.UUID; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticData.java index 24842a8e..7626b119 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticData.java @@ -1,4 +1,4 @@ -package kr.syeyoung.dungeonsguide.cosmetics; +package kr.syeyoung.dungeonsguide.mod.cosmetics; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java index fa597962..4a625574 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CosmeticsManager.java @@ -16,15 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics; - -import com.google.gson.JsonPrimitive; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.cosmetics.chatreplacers.*; -import kr.syeyoung.dungeonsguide.events.PlayerListItemPacketEvent; -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; -import kr.syeyoung.dungeonsguide.stomp.*; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.cosmetics; + +import kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers.*; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerListItemPacketEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.StompConnectedEvent; +import kr.syeyoung.dungeonsguide.mod.stomp.*; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; @@ -32,12 +29,8 @@ import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.play.server.S38PacketPlayerListItem; -import net.minecraft.scoreboard.ScorePlayerTeam; -import net.minecraft.util.*; import net.minecraftforge.client.event.ClientChatReceivedEvent; -import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.ReflectionHelper; @@ -48,10 +41,8 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -public class CosmeticsManager implements StompMessageHandler { +public class CosmeticsManager { @Getter private Map<UUID, CosmeticData> cosmeticDataMap = new ConcurrentHashMap<>(); @Getter @@ -66,44 +57,63 @@ public class CosmeticsManager implements StompMessageHandler { private Set<String> perms = new CopyOnWriteArraySet<>(); public void requestActiveCosmetics() { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload() + StompManager.getInstance().send(new StompPayload() .method(StompHeader.SEND) - .header("destination", "/app/cosmetic.activelist") + .destination("/app/cosmetic.activelist") ); } public void requestCosmeticsList() { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload() + StompManager.getInstance().send(new StompPayload() .method(StompHeader.SEND) - .header("destination", "/app/cosmetic.list") + .destination("/app/cosmetic.list") ); } public void requestPerms() { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload() + StompManager.getInstance().send(new StompPayload() .method(StompHeader.SEND) - .header("destination", "/app/user.perms") + .destination("/app/user.perms") ); } public void setCosmetic(CosmeticData cosmetic) { if (!perms.contains(cosmetic.getReqPerm())) return; - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload() + StompManager.getInstance().send(new StompPayload() .method(StompHeader.SEND) - .header("destination", "/app/cosmetic.set") + .destination("/app/cosmetic.set") .payload(cosmetic.getId().toString()) ); } public void removeCosmetic(ActiveCosmetic activeCosmetic) { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload() + StompManager.getInstance().send(new StompPayload() .method(StompHeader.SEND) - .header("destination", "/app/cosmetic.remove") + .destination("/app/cosmetic.remove") .payload(activeCosmetic.getActivityUID().toString()) ); } - @Override - public void handle(StompInterface stompInterface, StompPayload stompPayload) { - String destination = stompPayload.headers().get("destination"); - if (destination.equals("/topic/cosmetic.set")) { - JSONObject jsonObject = new JSONObject(stompPayload.payload()); + private void rebuildCaches() { + activeCosmeticByType = new HashMap<>(); + activeCosmeticByPlayer = new HashMap<>(); + Map<String, List<ActiveCosmetic>> activeCosmeticByPlayerName = new HashMap<>(); + for (ActiveCosmetic value : activeCosmeticMap.values()) { + CosmeticData cosmeticData = cosmeticDataMap.get(value.getCosmeticData()); + if (cosmeticData != null) { + List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new CopyOnWriteArrayList<>()); + cosmeticsByTypeList.add(value); + } + List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(value.getPlayerUID(), a-> new CopyOnWriteArrayList<>()); + activeCosmetics.add(value); + activeCosmetics = activeCosmeticByPlayerName.computeIfAbsent(value.getUsername().toLowerCase(), a-> new CopyOnWriteArrayList<>()); + activeCosmetics.add(value); + } + + this.activeCosmeticByPlayerNameLowerCase = activeCosmeticByPlayerName; + } + + @SubscribeEvent + public void stompConnect(StompConnectedEvent e) { + + e.getStompInterface().subscribe("/topic/cosmetic.set", (stompClient, payload) -> { + JSONObject jsonObject = new JSONObject(payload); ActiveCosmetic activeCosmetic = new ActiveCosmetic(); activeCosmetic.setActivityUID(UUID.fromString(jsonObject.getString("activityUID"))); activeCosmetic.setPlayerUID(UUID.fromString(jsonObject.getString("playerUID"))); @@ -148,18 +158,24 @@ public class CosmeticsManager implements StompMessageHandler { EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(activeCosmetic.getPlayerUID()); if (entityPlayer != null) entityPlayer.refreshDisplayName(); } - } catch (Exception e) {e.printStackTrace();} + } catch (Exception exception) {exception.printStackTrace();} + }); + - } else if (destination.equals("/user/queue/reply/user.perms")) { - JSONArray object = new JSONArray(stompPayload.payload()); + e.getStompInterface().subscribe("/user/queue/reply/user.perms", (stompClient ,payload) -> { + JSONArray object = new JSONArray(payload); Set<String> cache = new HashSet<>(); for (Object o : object) { cache.add((String) o); } this.perms = cache; - } else if (destination.equals("/user/queue/reply/cosmetic.activelist")) { - Map<UUID, ActiveCosmetic> activeCosmeticMap = new HashMap<>(); - JSONArray object = new JSONArray(stompPayload.payload()); + }); + + + + e.getStompInterface().subscribe("/user/queue/reply/cosmetic.activelist", (stompClient, payload) -> { + activeCosmeticMap = new HashMap<>(); + JSONArray object = new JSONArray(payload); for (Object o : object) { JSONObject jsonObject = (JSONObject) o; ActiveCosmetic cosmeticData = new ActiveCosmetic(); @@ -174,12 +190,15 @@ public class CosmeticsManager implements StompMessageHandler { EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(cosmeticData.getPlayerUID()); if (entityPlayer != null) entityPlayer.refreshDisplayName(); } - } catch (Exception e) {e.printStackTrace();} + } catch (Exception exception) {exception.printStackTrace();} } - this.activeCosmeticMap = activeCosmeticMap; rebuildCaches(); - } else if (destination.equals("/user/queue/reply/cosmetic.list")) { - JSONArray object = new JSONArray(stompPayload.payload()); + }); + + + + e.getStompInterface().subscribe("/user/queue/reply/cosmetic.list", (stompClient ,payload) -> { + JSONArray object = new JSONArray(payload); Map<UUID, CosmeticData> newCosmeticList = new HashMap<>(); for (Object o : object) { JSONObject jsonObject = (JSONObject) o; @@ -194,40 +213,8 @@ public class CosmeticsManager implements StompMessageHandler { cosmeticDataMap = newCosmeticList; rebuildCaches(); - } - } + }); - private void rebuildCaches() { - Map<String, List<ActiveCosmetic>> activeCosmeticByType = new HashMap<>(); - Map<UUID, List<ActiveCosmetic>> activeCosmeticByPlayer = new HashMap<>(); - Map<String, List<ActiveCosmetic>> activeCosmeticByPlayerName = new HashMap<>(); - for (ActiveCosmetic value : activeCosmeticMap.values()) { - CosmeticData cosmeticData = cosmeticDataMap.get(value.getCosmeticData()); - if (cosmeticData != null) { - List<ActiveCosmetic> cosmeticsByTypeList = activeCosmeticByType.computeIfAbsent(cosmeticData.getCosmeticType(), a-> new CopyOnWriteArrayList<>()); - cosmeticsByTypeList.add(value); - } - List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.computeIfAbsent(value.getPlayerUID(), a-> new CopyOnWriteArrayList<>()); - activeCosmetics.add(value); - activeCosmetics = activeCosmeticByPlayerName.computeIfAbsent(value.getUsername().toLowerCase(), a-> new CopyOnWriteArrayList<>()); - activeCosmetics.add(value); - } - - this.activeCosmeticByPlayerNameLowerCase = activeCosmeticByPlayerName; - this.activeCosmeticByPlayer = activeCosmeticByPlayer; - this.activeCosmeticByType = activeCosmeticByType; - } - - @SubscribeEvent - public void stompConnect(StompConnectedEvent stompConnectedEvent) { - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/topic/cosmetic.set").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/reply/user.perms").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/reply/cosmetic.activelist").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/reply/cosmetic.list").build()); requestCosmeticsList(); requestActiveCosmetics(); @@ -279,7 +266,8 @@ public class CosmeticsManager implements StompMessageHandler { public void nameFormat(PlayerEvent.NameFormat nameFormat) { List<ActiveCosmetic> activeCosmetics = activeCosmeticByPlayer.get(nameFormat.entityPlayer.getGameProfile().getId()); if (activeCosmetics == null) return; - CosmeticData color=null, prefix=null; + CosmeticData color=null; + CosmeticData prefix=null; for (ActiveCosmetic activeCosmetic : activeCosmetics) { CosmeticData cosmeticData = cosmeticDataMap.get(activeCosmetic.getCosmeticData()); if (cosmeticData !=null && cosmeticData.getCosmeticType().equals("color")) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CustomNetworkPlayerInfo.java index cfbf1fc0..7be9a1ca 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomNetworkPlayerInfo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CustomNetworkPlayerInfo.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics; +package kr.syeyoung.dungeonsguide.mod.cosmetics; import com.mojang.authlib.GameProfile; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.network.play.server.S38PacketPlayerListItem; import net.minecraft.scoreboard.ScorePlayerTeam; @@ -30,56 +30,58 @@ import net.minecraft.util.IChatComponent; import java.util.List; public class CustomNetworkPlayerInfo extends NetworkPlayerInfo { - public CustomNetworkPlayerInfo(GameProfile p_i46294_1_) { - super(p_i46294_1_); + public CustomNetworkPlayerInfo(GameProfile gameProfile) { + super(gameProfile); } - public CustomNetworkPlayerInfo(S38PacketPlayerListItem.AddPlayerData p_i46295_1_) { - super(p_i46295_1_); + public CustomNetworkPlayerInfo(S38PacketPlayerListItem.AddPlayerData playerData) { + super(playerData); setDisplayName(super.getDisplayName()); } private IChatComponent displayName; - private String playernameLowercase; - private String unformatted; - private String actualName; + private String unformattedDisplayText; + private String playerNameWithoutColor; + @Override public void setDisplayName(IChatComponent displayNameIn) { displayName = displayNameIn; if (displayName == null) { - playernameLowercase = null; - unformatted = null; + unformattedDisplayText = null; return; } - unformatted = displayName.getUnformattedText(); + unformattedDisplayText = displayName.getUnformattedTextForChat(); - actualName = ""; - for (String s : unformatted.split(" ")) { + playerNameWithoutColor = ""; + for (String s : unformattedDisplayText.split(" ")) { String strippped = TextUtils.stripColor(s); - if (strippped.startsWith("[")) continue; - actualName = strippped; + if (strippped.startsWith("[")) { + continue; + } + playerNameWithoutColor = strippped; break; } - playernameLowercase = actualName.toLowerCase(); } public IChatComponent getDisplayName() { - String semi_name; + String rawPlayerString; String actualName; List<ActiveCosmetic> activeCosmetics; - if (playernameLowercase != null) { - activeCosmetics = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getActiveCosmeticByPlayerNameLowerCase().get(playernameLowercase); - semi_name = unformatted; - actualName = this.actualName; + + // in case that the set player name is not called we do this + if (playerNameWithoutColor != null) { + activeCosmetics = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getActiveCosmeticByPlayerNameLowerCase().get(playerNameWithoutColor.toLowerCase()); + rawPlayerString = unformattedDisplayText; + actualName = this.playerNameWithoutColor; } else { - semi_name = ScorePlayerTeam.formatPlayerName(super.getPlayerTeam(), super.getGameProfile().getName()); + rawPlayerString = ScorePlayerTeam.formatPlayerName(super.getPlayerTeam(), super.getGameProfile().getName()); actualName = ""; - for (String s : semi_name.split(" ")) { + for (String s : rawPlayerString.split(" ")) { String strippped = TextUtils.stripColor(s); if (strippped.startsWith("[")) continue; actualName = strippped; @@ -96,8 +98,11 @@ public class CustomNetworkPlayerInfo extends NetworkPlayerInfo { if (cosmeticData.getCosmeticType().equals("color")) color = cosmeticData; } - if (color != null) semi_name = semi_name.replace(actualName, color.getData()+actualName); - - return new ChatComponentText(semi_name); + if (color != null) { + String coloredName = color.getData() + actualName; + return new ChatComponentText(rawPlayerString.replace(actualName, coloredName)); + } else { + return new ChatComponentText(rawPlayerString); + } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomPacketPlayerListItem.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CustomPacketPlayerListItem.java index 2f957c42..3406288d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CustomPacketPlayerListItem.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/CustomPacketPlayerListItem.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics; +package kr.syeyoung.dungeonsguide.mod.cosmetics; -import kr.syeyoung.dungeonsguide.events.PlayerListItemPacketEvent; -import net.minecraft.network.Packet; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerListItemPacketEvent; import net.minecraft.network.play.INetHandlerPlayClient; import net.minecraft.network.play.server.S38PacketPlayerListItem; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/IChatReplacer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/IChatReplacer.java index b2bcfc0e..483fadcf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/IChatReplacer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/IChatReplacer.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics; +package kr.syeyoung.dungeonsguide.mod.cosmetics; import net.minecraftforge.client.event.ClientChatReceivedEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerChatByMe.java index 8c99847a..4e50b110 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerChatByMe.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics.chatreplacers; +package kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.IChatReplacer; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.cosmetics.IChatReplacer; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; import net.minecraft.util.IChatComponent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerCoop.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerCoop.java index 91bb58b6..df003ec7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerCoop.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerCoop.java @@ -16,22 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics.chatreplacers; +package kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.IChatReplacer; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.cosmetics.IChatReplacer; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatStyle; import net.minecraft.util.IChatComponent; import net.minecraft.util.Tuple; import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.util.ArrayList; import java.util.List; -import java.util.UUID; public class ChatReplacerCoop implements IChatReplacer { @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerMessage.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerMessage.java index 14c2bd11..e819ca7f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerMessage.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerMessage.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics.chatreplacers; +package kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.IChatReplacer; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.cosmetics.IChatReplacer; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; import net.minecraft.util.IChatComponent; @@ -31,7 +31,6 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.util.ArrayList; import java.util.List; -import java.util.UUID; public class ChatReplacerMessage implements IChatReplacer { @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerPV.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerPV.java index e5e4053f..b4e1b777 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerPV.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerPV.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics.chatreplacers; +package kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.IChatReplacer; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.cosmetics.IChatReplacer; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; import net.minecraftforge.client.event.ClientChatReceivedEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerSocialOptions.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerSocialOptions.java index a1afd592..acbdf623 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerSocialOptions.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerSocialOptions.java @@ -16,21 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics.chatreplacers; +package kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.IChatReplacer; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.cosmetics.IChatReplacer; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.Tuple; import net.minecraftforge.client.event.ClientChatReceivedEvent; -import java.util.ArrayList; import java.util.List; -import java.util.UUID; public class ChatReplacerSocialOptions implements IChatReplacer { @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerViewProfile.java index dd5bbd70..28d1d3d0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/cosmetics/chatreplacers/ChatReplacerViewProfile.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.cosmetics.chatreplacers; +package kr.syeyoung.dungeonsguide.mod.cosmetics.chatreplacers; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.IChatReplacer; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.cosmetics.IChatReplacer; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import net.minecraft.util.Tuple; @@ -30,7 +30,6 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.util.ArrayList; import java.util.List; -import java.util.UUID; public class ChatReplacerViewProfile implements IChatReplacer { @Override @@ -47,7 +46,10 @@ public class ChatReplacerViewProfile implements IChatReplacer { for (IChatComponent sibling : event.message.getSiblings()) { if (sibling.getChatStyle() != null && sibling.getChatStyle().getChatClickEvent() != null && sibling.getChatStyle().getChatClickEvent().getValue().startsWith("/viewprofile ")) { String uid = sibling.getChatStyle().getChatClickEvent().getValue().split(" ")[1]; - List<ActiveCosmetic> cDatas = cosmeticsManager.getActiveCosmeticByPlayer().get(UUID.fromString(uid)); + // TODO: make cosmeticsManager handle usernames instead of uuids + // apperantly now hypixels /viewprofile command gives the nickname +// List<ActiveCosmetic> cDatas = cosmeticsManager.getActiveCosmeticByPlayer().get(UUID.fromString(uid)); + List<ActiveCosmetic> cDatas = null; if (cDatas != null) { CosmeticData color=null, prefix=null; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/GameSDK.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/GameSDK.java index 39885ab9..f66043b5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/GameSDK.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/GameSDK.java @@ -16,21 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Platform; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.PointerByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.*; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.*; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordActivityEvents; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordActivityManager; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordCore; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.*; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.GameSDKTypeMapper; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; import lombok.Getter; import java.io.File; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/GameSDKTypeMapper.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/GameSDKTypeMapper.java index 1d8a4ef8..e895935a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/GameSDKTypeMapper.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/GameSDKTypeMapper.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna; import com.sun.jna.DefaultTypeMapper; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.*; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.*; public class GameSDKTypeMapper extends DefaultTypeMapper { public static final GameSDKTypeMapper INSTANCE = new GameSDKTypeMapper(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/NativeGameSDK.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/NativeGameSDK.java index 59fc0339..b11f141c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/NativeGameSDK.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/NativeGameSDK.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna; import com.sun.jna.Callback; import com.sun.jna.Library; import com.sun.jna.Pointer; import com.sun.jna.ptr.PointerByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordCreateParams; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordVersion; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordCreateParams; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordVersion; public interface NativeGameSDK extends Library { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivity.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivity.java index d257b414..3bd0c612 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivity.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivity.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int64; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int64; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityAssets.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityAssets.java index 03b64f46..fe9bf1ca 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityAssets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityAssets.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityParty.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityParty.java index b9a20db3..ee0730af 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityParty.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityParty.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivitySecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivitySecrets.java index 2975f97f..6a43412c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivitySecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivitySecrets.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityTimestamps.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityTimestamps.java index 4765ffb9..8a8d06b8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordActivityTimestamps.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordActivityTimestamps.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordTimestamp; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordTimestamp; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordCreateParams.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordCreateParams.java index 10f1ba3d..9c7e15a9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordCreateParams.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordCreateParams.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.*; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordClientID; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordVersion; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt64; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct.*; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordClientID; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordVersion; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt64; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordEntitlement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordEntitlement.java index 6e0f29ac..85ef593b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordEntitlement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordEntitlement.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordEntitlementType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordEntitlementType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordFileStat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordFileStat.java index a7e38b37..40f72b6c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordFileStat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordFileStat.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt64; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt64; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageDimensions.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordImageDimensions.java index d3247b07..c6a55c42 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageDimensions.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordImageDimensions.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageHandle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordImageHandle.java index 2ca33f46..c52dfebc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordImageHandle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordImageHandle.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordImageType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int64; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordImageType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int64; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordInputMode.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordInputMode.java index 8a69f53a..d0b8589b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordInputMode.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordInputMode.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordInputModeType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordInputModeType; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordLobby.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordLobby.java index 18453004..c89dc1cf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordLobby.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordLobby.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbyType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordLobbyType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordOAuth2Token.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordOAuth2Token.java index f870f830..937b23de 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordOAuth2Token.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordOAuth2Token.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordTimestamp; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordTimestamp; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPartySize.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordPartySize.java index 43c40723..522efeaa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPartySize.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordPartySize.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPresence.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordPresence.java index 4e12f175..b5fc0f0e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordPresence.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordPresence.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordStatus; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordStatus; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordRelationship.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordRelationship.java index 03cbae4a..4115e684 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordRelationship.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordRelationship.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordRelationshipType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordRelationshipType; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSku.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordSku.java index 2e9aaf1d..bfd90e22 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSku.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordSku.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordSkuType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordSkuType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSkuPrice.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordSkuPrice.java index 6eea0924..c69ca97a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordSkuPrice.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordSkuPrice.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordStruct.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordStruct.java index f6a19d82..12292692 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordStruct.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordStruct.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Library; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import com.sun.jna.TypeMapper; -import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.GameSDKTypeMapper; import java.util.Collections; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUser.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordUser.java index b20d18c2..3db714dc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUser.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordUser.java @@ -16,14 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; - -import lombok.Getter; -import lombok.Setter; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUserAchievement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordUserAchievement.java index c12dcf56..db13ab77 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/datastruct/DiscordUserAchievement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/datastruct/DiscordUserAchievement.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityActionType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityActionType.java index d46fdfc6..9004c339 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityActionType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityActionType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java index a8deda60..43f0c0ef 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityJoinRequestReply.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityType.java index 9328758a..7ed2ec54 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordActivityType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordActivityType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordCreateFlags.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordCreateFlags.java index 29598b47..60606213 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordCreateFlags.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordCreateFlags.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordEntitlementType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordEntitlementType.java index d155fbc6..85150f0a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordEntitlementType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordEntitlementType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordImageType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordImageType.java index db4258db..f516e1a9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordImageType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordImageType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordInputModeType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordInputModeType.java index 1cc49b7e..aeba1c22 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordInputModeType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordInputModeType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java index 5bd97267..d2c78f39 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchCast.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java index 5cc8f934..9a8819d4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchComparison.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java index e8a920ea..5e4927ee 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbySearchDistance.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbyType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbyType.java index d8353d59..62b7c154 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLobbyType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLobbyType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLogLevel.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLogLevel.java index 0fa0f3ab..8487a0e6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordLogLevel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordLogLevel.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordPremiumType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordPremiumType.java index 4ca426d5..139264b1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordPremiumType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordPremiumType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordRelationshipType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordRelationshipType.java index b2edb714..ddc5cadb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordRelationshipType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordRelationshipType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordResult.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordResult.java index cb0541bf..9447fc58 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordResult.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordResult.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordSkuType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordSkuType.java index ba174a17..69442f2d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordSkuType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordSkuType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordStatus.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordStatus.java index b788aa62..0ef1892e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordStatus.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordStatus.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordUserFlag.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordUserFlag.java index 242e5f1e..1ba8f40f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/enumuration/EDiscordUserFlag.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/enumuration/EDiscordUserFlag.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration; import com.sun.jna.FromNativeContext; import com.sun.jna.ToNativeContext; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/GameSDKCallback.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/GameSDKCallback.java index 6f139163..e997e699 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/GameSDKCallback.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/GameSDKCallback.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; import com.sun.jna.Callback; import com.sun.jna.Library; -import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.GameSDKTypeMapper; import java.util.Collections; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java index e7cf3b38..a75e0186 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordAchievementEvents.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUserAchievement; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUserAchievement; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java index f83c0195..40d37327 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordAchievementManager.java @@ -16,19 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.IntByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUserAchievement; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUserAchievement; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java index d6a6ce48..d340e544 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordActivityEvents.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordActivity; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityActionType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordActivity; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUser; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordActivityManager.java index b20e6660..2cab2538 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordActivityManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordActivityManager.java @@ -16,19 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordActivity; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityJoinRequestReply; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityActionType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordActivity; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityJoinRequestReply; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java index a8165234..ff07aec8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordApplicationManager.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordOAuth2Token; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordOAuth2Token; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordCore.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordCore.java index 7519987e..95e4ad16 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordCore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordCore.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.TypeMapper; -import kr.syeyoung.dungeonsguide.gamesdk.jna.GameSDKTypeMapper; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.GameSDKTypeMapper; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLogLevel; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordLogLevel; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordImageManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordImageManager.java index 7c42ea33..208f6cec 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordImageManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordImageManager.java @@ -16,17 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import com.sun.jna.ptr.ByteByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordImageDimensions; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordImageHandle; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordImageDimensions; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordImageHandle; import java.nio.ByteBuffer; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java index 268fe2f5..72ee2293 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyEvents.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int64; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int64; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java index bfaf3c4a..08bfba44 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyManager.java @@ -16,22 +16,21 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; import com.sun.jna.ptr.IntByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordLobby; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordLobby; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUser; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java index d061d34b..43834182 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyMemberTransaction.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java index af2bb1ea..83019eb6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbySearchQuery.java @@ -16,17 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbySearchComparison; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbySearchDistance; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbySearchCast; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordLobbySearchComparison; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordLobbySearchDistance; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordLobbySearchCast; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java index 354c3b37..0005c2bf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordLobbyTransaction.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordLobbyType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordLobbyType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java index 0c99e5c6..2f08f975 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordNetworkEvents.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkChannelId; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkPeerId; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordNetworkChannelId; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordNetworkPeerId; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java index b14bb832..7ec25896 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordNetworkManager.java @@ -16,18 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Pointer; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; import com.sun.jna.ptr.LongByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkChannelId; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordNetworkPeerId; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordNetworkChannelId; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordNetworkPeerId; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java index 91ab9e81..f4a1d544 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordOverlayEvents.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java index 9c39ed38..3283d21e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordOverlayManager.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityActionType; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java index 259ca819..97da94ee 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordRelationshipEvents.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordRelationship; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordRelationship; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java index 1b3ffe16..e0084c98 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordRelationshipManager.java @@ -16,17 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.IntByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordRelationship; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordRelationship; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStorageManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStorageManager.java index 8e62b115..035ee652 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStorageManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStorageManager.java @@ -16,20 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; import com.sun.jna.ptr.IntByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordFileStat; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt64; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordFileStat; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt64; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java index 8b3cbd69..e6df07d0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStoreEvents.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordEntitlement; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordEntitlement; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStoreManager.java index ce5ec134..3e387923 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordStoreManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordStoreManager.java @@ -16,20 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; import com.sun.jna.ptr.IntByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordSku; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordEntitlement; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.Int32; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordSku; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordEntitlement; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.Int32; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordUserEvents.java index 72e22b91..0e80acb1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordUserEvents.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordUserManager.java index f74c233a..c4803a7d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordUserManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordUserManager.java @@ -16,18 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; import com.sun.jna.ptr.IntByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordUserFlag; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordUserFlag; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUser; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java index 301de3ad..0e4b4731 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordVoiceEvents.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java index f9881008..833a1ca4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/interfacestruct/IDiscordVoiceManager.java @@ -16,18 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct; -import com.sun.jna.Callback; import com.sun.jna.Structure; import com.sun.jna.ptr.ByteByReference; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordStruct; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordStruct; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordResult; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.UInt8; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordInputMode; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordResult; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.UInt8; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordInputMode; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordClientID.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordClientID.java index df6c4628..56e8f64c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordClientID.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordClientID.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; - -import com.sun.jna.IntegerType; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; public class DiscordClientID extends Int64 { public DiscordClientID() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkChannelId.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordNetworkChannelId.java index 82b34ee7..54dcbece 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkChannelId.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordNetworkChannelId.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; - -import com.sun.jna.IntegerType; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; public class DiscordNetworkChannelId extends UInt8 { public DiscordNetworkChannelId() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkPeerId.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordNetworkPeerId.java index 49d73e3f..c7493ffb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordNetworkPeerId.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordNetworkPeerId.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; - -import com.sun.jna.IntegerType; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; public class DiscordNetworkPeerId extends UInt64 { public DiscordNetworkPeerId() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordSnowflake.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordSnowflake.java index 3a86f73d..15681202 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordSnowflake.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordSnowflake.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; - -import com.sun.jna.IntegerType; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; public class DiscordSnowflake extends Int64 { public DiscordSnowflake() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordTimestamp.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordTimestamp.java index c8f73da5..6b5fce90 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordTimestamp.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordTimestamp.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; - -import com.sun.jna.IntegerType; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; public class DiscordTimestamp extends Int64 { public DiscordTimestamp() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordVersion.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordVersion.java index ed5fda42..eda4dcdf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/DiscordVersion.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/DiscordVersion.java @@ -16,9 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; - -import com.sun.jna.IntegerType; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; public class DiscordVersion extends Int32 { public DiscordVersion() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int32.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/Int32.java index 581aed96..84210e6b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int32.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/Int32.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; import com.sun.jna.IntegerType; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int64.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/Int64.java index a8dff873..7ee7e61a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/Int64.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/Int64.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; import com.sun.jna.IntegerType; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt32.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt32.java index 98a903c6..ff7db8a8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt32.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt32.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; import com.sun.jna.IntegerType; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt64.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt64.java index a0265b34..360a80ee 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt64.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt64.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; import com.sun.jna.IntegerType; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt8.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt8.java index 1b10c5a2..f48ebd06 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gamesdk/jna/typedef/UInt8.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/gamesdk/jna/typedef/UInt8.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gamesdk.jna.typedef; +package kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef; import com.sun.jna.IntegerType; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordActivity.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordActivity.java index f25022f2..76b11178 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordActivity.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordActivity.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.rpc; +package kr.syeyoung.dungeonsguide.mod.discord.rpc; -import kr.syeyoung.dungeonsguide.gamesdk.GameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordActivity; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.GameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordActivity; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityType; import lombok.Data; @Data diff --git a/src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordRelation.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordRelation.java index 3086c936..ae7ed1a6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordRelation.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordRelation.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.rpc; +package kr.syeyoung.dungeonsguide.mod.discord.rpc; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordRelationship; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordRelationshipType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordStatus; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordRelationship; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordRelationshipType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordStatus; import lombok.Data; @Data diff --git a/src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordUser.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordUser.java index 635ac405..a56cd884 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/rpc/JDiscordUser.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/JDiscordUser.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.rpc; +package kr.syeyoung.dungeonsguide.mod.discord.rpc; -import kr.syeyoung.dungeonsguide.gamesdk.GameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.GameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUser; import lombok.Data; @Data diff --git a/src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/RichPresenceManager.java index 5ff9852b..9e2f249d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/rpc/RichPresenceManager.java @@ -16,25 +16,25 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.rpc; +package kr.syeyoung.dungeonsguide.mod.discord.rpc; import com.sun.jna.Pointer; import com.sun.jna.ptr.IntByReference; import com.sun.jna.ptr.PointerByReference; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.chat.PartyContext; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.events.DiscordUserJoinRequestEvent; -import kr.syeyoung.dungeonsguide.events.DiscordUserUpdateEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gamesdk.GameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.NativeGameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.*; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.*; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.*; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.*; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.party.PartyContext; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.events.impl.DiscordUserJoinRequestEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.DiscordUserUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.GameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.NativeGameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.*; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.*; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct.*; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.*; import lombok.Getter; import net.minecraftforge.common.MinecraftForge; @@ -179,7 +179,7 @@ public class RichPresenceManager implements Runnable { activityManager.ClearActivity.clearActivity(activityManager, Pointer.NULL, (callbackData, result) -> { }); } else { - String name = skyblockStatus.getDungeonName() == null ? "" : skyblockStatus.getDungeonName(); + String name = DungeonContext.getDungeonName() == null ? "" : DungeonContext.getDungeonName(); if (!skyblockStatus.isOnSkyblock()) name ="Somewhere on Hypixel"; if (name.trim().equals("Your Island")) name = "Private Island"; @@ -197,13 +197,13 @@ public class RichPresenceManager implements Runnable { latestDiscordActivity.party.discordActivityParty.current_size = new Int32(Optional.ofNullable(PartyManager.INSTANCE.getPartyContext()).map(PartyContext::getPartyRawMembers).map(Set::size).orElse(1)); latestDiscordActivity.party.discordActivityParty.max_size = new Int32(PartyManager.INSTANCE.getMaxParty()); - if (skyblockStatus.getContext() != null) { - DungeonContext dungeonContext = skyblockStatus.getContext(); - long init = dungeonContext.getInit(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context != null) { + long init = context.getInit(); latestDiscordActivity.timestamps.start = new DiscordTimestamp(init); - if (dungeonContext.getBossfightProcessor() != null) { - GameSDK.writeString(latestDiscordActivity.details, "Fighting "+dungeonContext.getBossfightProcessor().getBossName()+": "+dungeonContext.getBossfightProcessor().getCurrentPhase()); + if (context.getBossfightProcessor() != null) { + GameSDK.writeString(latestDiscordActivity.details, "Fighting "+context.getBossfightProcessor().getBossName()+": "+context.getBossfightProcessor().getCurrentPhase()); } else { GameSDK.writeString(latestDiscordActivity.details, "Clearing Rooms"); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonActionManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonActionContext.java index 667f329c..f9541a3d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonActionManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonActionContext.java @@ -16,12 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon; +package kr.syeyoung.dungeonsguide.mod.dungeon; import lombok.Getter; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import java.util.ArrayList; @@ -29,10 +26,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class DungeonActionManager { +public class DungeonActionContext { @Getter - private static final Map<Integer , Vec3> spawnLocation = new HashMap<Integer, Vec3>(); + private static final Map<Integer, Vec3> spawnLocation = new HashMap<>(); @Getter - private static final List<Integer> killeds = new ArrayList<Integer>(); + private static final List<Integer> killeds = new ArrayList<>(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonContext.java index bd04d7a9..32a668c0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonContext.java @@ -16,24 +16,27 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProvider; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProviderRegistry; -import kr.syeyoung.dungeonsguide.dungeon.events.*; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.BossroomEnterEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.dungeon.FeatureDungeonMap; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessor; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.dungeon; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProvider; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProviderRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonCryptBrokenEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonNodataEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonPuzzleFailureEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonSecretCountChangeEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessor; +import kr.syeyoung.dungeonsguide.mod.events.impl.BossroomEnterEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.TabListUtil; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; -import net.minecraft.client.network.NetworkPlayerInfo; -import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; @@ -42,10 +45,21 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.common.MinecraftForge; import java.awt.*; -import java.util.*; import java.util.List; +import java.util.*; public class DungeonContext { + /** + * This is static because its used in the constructor, + * it means we cannot set the name without having an object, + * and we cannot create an object without the name + * so its static :) + */ + @Getter @Setter + private static String dungeonName; + @Getter + @Setter + public int percentage; @Getter private final World world; @Getter @@ -56,17 +70,17 @@ public class DungeonContext { private BlockPos dungeonMin; @Getter - private final Map<Point, DungeonRoom> roomMapper = new HashMap<Point, DungeonRoom>(); + private final Map<Point, DungeonRoom> roomMapper = new HashMap<>(); @Getter - private final List<DungeonRoom> dungeonRoomList = new ArrayList<DungeonRoom>(); + private final List<DungeonRoom> dungeonRoomList = new ArrayList<>(); @Getter - private final List<RoomProcessor> globalRoomProcessors = new ArrayList<RoomProcessor>(); + private final List<RoomProcessor> globalRoomProcessors = new ArrayList<>(); @Getter - private final Map<String, Integer> deaths = new HashMap<String, Integer>(); + private final Map<String, Integer> deaths = new HashMap<>(); @Getter - private final List<String[]> milestoneReached = new ArrayList<String[]>(); + private final List<String[]> milestoneReached = new ArrayList<>(); @Getter @Setter private long BossRoomEnterSeconds = -1; @@ -103,56 +117,53 @@ public class DungeonContext { private BossfightProcessor bossfightProcessor; @Getter - private final Set<String> players = new HashSet<String>(); + private final Set<String> players = new HashSet<>(); @Getter - private final List<DungeonEvent> events = new ArrayList<DungeonEvent>(); + private final List<DungeonEvent> events = new ArrayList<>(); public DungeonContext(World world) { this.world = world; createEvent(new DungeonNodataEvent("DUNGEON_CONTEXT_CREATION")); mapProcessor = new MapProcessor(this); - DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); + DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(getDungeonName()); if (doorFinder != null) { - trapRoomGen = doorFinder.isTrapSpawn(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); + trapRoomGen = doorFinder.isTrapSpawn(getDungeonName()); - secretPercentage = doorFinder.secretPercentage(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); - maxSpeed = doorFinder.speedSecond(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); - } else mapProcessor.setBugged(true); + secretPercentage = doorFinder.secretPercentage(getDungeonName()); + maxSpeed = doorFinder.speedSecond(getDungeonName()); + } else { + mapProcessor.setBugged(true); + } init = System.currentTimeMillis(); } public void createEvent(DungeonEventData eventData) { - events.add(new DungeonEvent(eventData)); +// events.add(new DungeonEvent(eventData)); } - private final Rectangle roomBoundary = new Rectangle(-10,-10,138,138); + private final Rectangle roomBoundary = new Rectangle(-10, -10, 138, 138); public void tick() { - mapProcessor.tick(); + if (mapProcessor.isInitialized() && BossRoomEnterSeconds == -1 && !roomBoundary.contains(mapProcessor.worldPointToMapPoint(Minecraft.getMinecraft().thePlayer.getPositionVector()))) { BossRoomEnterSeconds = FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed() / 1000; bossroomSpawnPos = Minecraft.getMinecraft().thePlayer.getPosition(); MinecraftForge.EVENT_BUS.post(new BossroomEnterEvent()); createEvent(new DungeonNodataEvent("BOSSROOM_ENTER")); - DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); + DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(getDungeonName()); if (doorFinder != null) { - bossfightProcessor = doorFinder.createBossfightProcessor(world, DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); + bossfightProcessor = doorFinder.createBossfightProcessor(world, getDungeonName()); } else { - DungeonsGuide.sendDebugChat(new ChatComponentText("Error:: Null Data Providier")); + ChatTransmitter.sendDebugChat(new ChatComponentText("Error:: Null Data Providier")); } } - List<NetworkPlayerInfo> list = FeatureDungeonMap.field_175252_a.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); - try { - for (int i = 1; i < 20; i++) { - NetworkPlayerInfo networkPlayerInfo = list.get(i); - String name = networkPlayerInfo.getDisplayName() != null ? networkPlayerInfo.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName()); - if (name.trim().equals("§r") || name.startsWith("§r ")) continue; - players.add(TextUtils.stripColor(name).trim().split(" ")[0]); - } - } catch (Exception e) {} + + players.clear(); + players.addAll(TabListUtil.getPlayersInDungeon()); + if (latestSecretCnt != FeatureRegistry.DUNGEON_SECRETS.getSecretsFound()) { int newSecretCnt = FeatureRegistry.DUNGEON_SECRETS.getSecretsFound(); @@ -174,6 +185,7 @@ public class DungeonContext { private boolean ended = false; @Getter private boolean defeated = false; + public void onChat(ClientChatReceivedEvent event) { IChatComponent component = event.message; String formatted = component.getFormattedText(); @@ -186,8 +198,8 @@ public class DungeonContext { int x = Integer.parseInt(coords.split("/")[0]); int z = Integer.parseInt(coords.split("/")[1]); int secrets2 = Integer.parseInt(secrets); - Point roomPt = mapProcessor.worldPointToRoomPoint(new BlockPos(x,70,z)); - DungeonsGuide.sendDebugChat(new ChatComponentText("Message from Other dungeons guide :: "+roomPt.x+" / " + roomPt.y + " total secrets "+secrets2)); + Point roomPt = mapProcessor.worldPointToRoomPoint(new BlockPos(x, 70, z)); + ChatTransmitter.sendDebugChat(new ChatComponentText("Message from Other dungeons guide :: " + roomPt.x + " / " + roomPt.y + " total secrets " + secrets2)); DungeonRoom dr = roomMapper.get(roomPt); if (dr != null) { dr.setTotalSecrets(secrets2); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonFacade.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonFacade.java new file mode 100644 index 00000000..96a951fd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/DungeonFacade.java @@ -0,0 +1,35 @@ +package kr.syeyoung.dungeonsguide.mod.dungeon; + +import kr.syeyoung.dungeonsguide.Main; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoomInfoRegistry; +import kr.syeyoung.dungeonsguide.mod.events.listener.DungeonListener; +import lombok.Getter; +import lombok.Setter; +import net.minecraftforge.common.MinecraftForge; + +import javax.crypto.BadPaddingException; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import java.io.IOException; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +public class DungeonFacade { + + @Getter + @Setter + private DungeonContext context; + + public void init() { + DungeonListener dgEventListener = new DungeonListener(); + MinecraftForge.EVENT_BUS.register(dgEventListener); + + try { + DungeonRoomInfoRegistry.loadAll(Main.getConfigDir()); + } catch (BadPaddingException | InvalidKeyException | NoSuchPaddingException | IllegalBlockSizeException | + IOException | NoSuchAlgorithmException | InvalidAlgorithmParameterException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java new file mode 100755 index 00000000..9c2462ea --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java @@ -0,0 +1,535 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.dungeon; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.Sets; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.EDungeonDoorType; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.SerializableBlockPos; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonMapUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonRoomDiscoverEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.map.DungeonMapData; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.MapUtils; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.*; +import net.minecraft.world.storage.MapData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.vecmath.Vector2d; +import java.awt.*; +import java.util.List; +import java.util.Queue; +import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class MapProcessor { + + private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0, 1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1, 0)); + private static final Set<Vector2d> door_dirs = Sets.newHashSet(new Vector2d(0, 0.5), new Vector2d(0, -0.5), new Vector2d(0.5, 0), new Vector2d(-0.5, 0)); + private static final Minecraft mc = Minecraft.getMinecraft(); + private final DungeonContext context; + @Getter + private final BiMap<String, String> mapIconToPlayerMap = HashBiMap.create(); + private final List<Point> roomsFound = new ArrayList<>(); + Logger logger = LogManager.getLogger("MapProcessor"); + /** + * If the player on the map is closer than value this it won't save it + * this should be done with render-distance but whateva + */ + int clossnessDistance = 50; + @Getter + @Setter + private Dimension unitRoomDimension; + @Getter @Setter + private Dimension doorDimensions; // width: width of door, height: gap between rooms + @Getter + @Setter + private Point topLeftMapPoint; + @Setter + private boolean bugged = false; + @Getter + private boolean initialized = false; + @Getter + private int undiscoveredRoom = 0; + private boolean processed = false; + @Getter + private MapData latestMapData; + private int waitDelay = 0; + private boolean processlock; + + public MapProcessor(DungeonContext context) { + this.context = context; + } + + private static void error(String prefix) { + ChatTransmitter.addToQueue(new ChatComponentText(ChatTransmitter.prefix + prefix)); + } + + + ExecutorService es = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("Dg-MapProcessor-%d").build()); + + + int processMapThroddle; + + public void tick() { + if (waitDelay < 5) { + waitDelay++; + return; + } + if (bugged) { + return; + } + ItemStack stack = Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(8); + + if (stack == null || !(stack.getItem() instanceof ItemMap)) { + return; + } + + MapData mapData = ((ItemMap) stack.getItem()).getMapData(stack, mc.theWorld); + + if (mapData != null) { + + if(processMapThroddle > 5 && !processlock){ + processMapData(mapData.colors); + processMapThroddle = 0; + } + processMapThroddle++; + + } + + latestMapData = mapData; + + if (latestMapData != null && mapIconToPlayerMap.size() < context.getPlayers().size() && initialized) { + getPlayersFromMap(latestMapData); + } + + } + + private void processMapData(byte[] mapColorData) { + + // i just cant get this to work sad + if (isThereDifference(latestMapData.colors, mapColorData)) { + context.createEvent(new DungeonMapUpdateEvent(mapColorData)); + + es.execute(() -> { + processlock = true; + if (doorDimensions == null || !initialized) { + assembleMap(mapColorData); + } else { + processMap(mapColorData); + } + + if (context.isEnded()) { + processFinishedMap(mapColorData); + } + processlock = false; + }); + + } + + } + + void assembleMap(final byte[] mapData){ + DungeonMapData data = new DungeonMapData(context, Minecraft.getMinecraft()); + + data.eat(mapData); + + bugged = data.bugged; + + unitRoomDimension = data.unitRoomDimension; + + topLeftMapPoint = data.topLeftMapPoint; + + initialized = data.initialized; + + doorDimensions = data.doorDimensions; + + } + + + public static Point mapPointToRoomPoint(Point mapPoint, Point topLeftMapPoint, Dimension unitRoomDimension, Dimension doorDimensions) { + int x = (int) ((mapPoint.x - topLeftMapPoint.x) / ((double) unitRoomDimension.width + doorDimensions.height)); + int y = (int) ((mapPoint.y - topLeftMapPoint.y) / ((double) unitRoomDimension.height + doorDimensions.height)); + return new Point(x, y); + } + + public BlockPos mapPointToWorldPoint(Point mapPoint) { + int x = (int) ((mapPoint.x - topLeftMapPoint.x) / ((double) unitRoomDimension.width + doorDimensions.height) * 32 + context.getDungeonMin().getX()); + int y = (int) ((mapPoint.y - topLeftMapPoint.y) / ((double) unitRoomDimension.height + doorDimensions.height) * 32 + context.getDungeonMin().getZ()); + return new BlockPos(x, 70, y); + } + + public Point roomPointToMapPoint(Point roomPoint) { + return new Point(roomPoint.x * (unitRoomDimension.width + doorDimensions.height) + topLeftMapPoint.x, roomPoint.y * (unitRoomDimension.height + doorDimensions.height) + topLeftMapPoint.y); + } + + public BlockPos roomPointToWorldPoint(Point roomPoint) { + return new BlockPos(context.getDungeonMin().getX() + (roomPoint.x * 32), context.getDungeonMin().getY(), context.getDungeonMin().getZ() + (roomPoint.y * 32)); + } + + public Point worldPointToRoomPoint(BlockPos worldPoint) { + if (context.getDungeonMin() == null) return null; + return new Point((worldPoint.getX() - context.getDungeonMin().getX()) / 32, (worldPoint.getZ() - context.getDungeonMin().getZ()) / 32); + } + + public Point worldPointToMapPoint(Vec3 worldPoint) { + if (context.getDungeonMin() == null) return null; + return new Point(topLeftMapPoint.x + (int) ((worldPoint.xCoord - context.getDungeonMin().getX()) / 32.0f * (unitRoomDimension.width + doorDimensions.height)), topLeftMapPoint.y + (int) ((worldPoint.zCoord - context.getDungeonMin().getZ()) / 32.0f * (unitRoomDimension.height + doorDimensions.height))); + } + + public Vector2d worldPointToMapPointFLOAT(Vec3 worldPoint) { + if (context.getDungeonMin() == null) return null; + double x = topLeftMapPoint.x + ((worldPoint.xCoord - context.getDungeonMin().getX()) / 32.0f * (unitRoomDimension.width + doorDimensions.height)); + double y = topLeftMapPoint.y + ((worldPoint.zCoord - context.getDungeonMin().getZ()) / 32.0f * (unitRoomDimension.height + doorDimensions.height)); + return new Vector2d(x, y); + } + + private void processMap(byte[] mapData) { + int roomHeight = (int) ((128.0 - topLeftMapPoint.y) / (unitRoomDimension.height + doorDimensions.height)); + int roomWidth = (int) ((128.0 - topLeftMapPoint.x) / (unitRoomDimension.width + doorDimensions.height)); + if (MapUtils.getMapColorAt(mapData, 0, 0) != 0) return; + undiscoveredRoom = 0; + for (int y = 0; y <= roomHeight; y++) { + for (int x = 0; x <= roomWidth; x++) { + Point mapPoint = roomPointToMapPoint(new Point(x, y)); + byte color = MapUtils.getMapColorAt(mapData, mapPoint.x, mapPoint.y); + MapUtils.record(mapData, mapPoint.x, mapPoint.y, new Color(255, 255, 0, 80)); + if (roomsFound.contains(new Point(x, y))) { + DungeonRoom dungeonRoom = context.getRoomMapper().get(new Point(x, y)); + if (color == 18 && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FINISHED) { + dungeonRoom.setCurrentState(DungeonRoom.RoomState.COMPLETE_WITHOUT_SECRETS); + dungeonRoom.setTotalSecrets(0); + } else if (color == 30) { + dungeonRoom.setCurrentState(DungeonRoom.RoomState.FINISHED); + dungeonRoom.setTotalSecrets(0); + } else if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FINISHED) { + byte centerColor = MapUtils.getMapColorAt(mapData, mapPoint.x + unitRoomDimension.width / 2, mapPoint.y + unitRoomDimension.height / 2); + MapUtils.record(mapData, mapPoint.x + unitRoomDimension.width / 2, mapPoint.y + unitRoomDimension.height / 2, new Color(0, 255, 0, 80)); + if (centerColor == 34) { + dungeonRoom.setCurrentState(DungeonRoom.RoomState.COMPLETE_WITHOUT_SECRETS); + } else if (centerColor == 30) { + dungeonRoom.setCurrentState(DungeonRoom.RoomState.FINISHED); + } else if (centerColor == 18) { // red + dungeonRoom.setCurrentState(DungeonRoom.RoomState.FAILED); + } + } + if (dungeonRoom.getTotalSecrets() == -1) { + if (dungeonRoom.getColor() == 82 || dungeonRoom.getColor() == 74) { + dungeonRoom.setTotalSecrets(0); + } + MapUtils.record(mapData, mapPoint.x, mapPoint.y + 1, new Color(0, 255, 0, 80)); + } + continue; + } + + if (color != 0 && color != 85) { + MapUtils.record(mapData, mapPoint.x, mapPoint.y, new Color(0, 255, 255, 80)); + DungeonRoom room = buildRoom(mapData, new Point(x, y)); + + + // USELESS DEBUG CODE + context.createEvent(new DungeonRoomDiscoverEvent(room.getUnitPoints().get(0), room.getRoomMatcher().getRotation(), new SerializableBlockPos(room.getMin()), new SerializableBlockPos(room.getMax()), room.getShape(), room.getColor(), room.getDungeonRoomInfo().getUuid(), room.getDungeonRoomInfo().getName(), room.getDungeonRoomInfo().getProcessorId())); + ChatTransmitter.sendDebugChat(new ChatComponentText("New Map discovered! shape: " + room.getShape() + " color: " + room.getColor() + " unitPos: " + x + "," + y)); + ChatTransmitter.sendDebugChat(new ChatComponentText("New Map discovered! mapMin: " + room.getMin() + " mapMx: " + room.getMax())); + StringBuilder builder = new StringBuilder(); + for (int dy = 0; dy < 4; dy++) { + builder.append("\n"); + for (int dx = 0; dx < 4; dx++) { + boolean isSet = ((room.getShape() >> (dy * 4 + dx)) & 0x1) != 0; + builder.append(isSet ? "O" : "X"); + } + } + ChatTransmitter.sendDebugChat(new ChatComponentText("Shape visual: " + builder)); + // END + + + context.getDungeonRoomList().add(room); + for (Point p : room.getUnitPoints()) { + roomsFound.add(p); + context.getRoomMapper().put(p, room); + } + if (room.getRoomProcessor() != null && room.getRoomProcessor().readGlobalChat()) { + context.getGlobalRoomProcessors().add(room.getRoomProcessor()); + } + } else if (color == 85) { + undiscoveredRoom++; + } + + } + } + } + + private DungeonRoom buildRoom(byte[] mapData, Point unitPoint) { + Queue<Point[]> toCheck = new LinkedList<>(); + toCheck.add(new Point[]{unitPoint, unitPoint}); // requestor, target + Set<Point> checked = new HashSet<>(); + List<Point> ayConnected = new ArrayList<>(); + + int minX = Integer.MAX_VALUE; + int minY = Integer.MAX_VALUE; + int maxX = 0; + int maxY = 0; + while (toCheck.peek() != null) { + Point[] check = toCheck.poll(); + if (checked.contains(check[1])) { + continue; + } + checked.add(check[1]); + + if (checkIfConnected(mapData, check[0], check[1])) { + ayConnected.add(check[1]); + if (check[1].x < minX) minX = check[1].x; + if (check[1].y < minY) minY = check[1].y; + if (check[1].x > maxX) maxX = check[1].x; + if (check[1].y > maxY) maxY = check[1].y; + for (Vector2d dir : directions) { + Point newPt = new Point(check[1].x + (int) dir.x, check[1].y + (int) dir.y); + toCheck.add(new Point[]{check[1], newPt}); + } + } + } + + short shape = 0; + for (Point p : ayConnected) { + int localX = p.x - minX; + int localY = p.y - minY; + shape |= 1 << (localY * 4 + localX); + } + Set<Vector2d> doors = new HashSet<>(); + for (Point p : ayConnected) { + for (Vector2d v : door_dirs) { + Vector2d v2 = new Vector2d(p.x + v.x, p.y + v.y); + if (doors.contains(v2)) doors.remove(v2); + else doors.add(v2); + } + } + Point pt2 = roomPointToMapPoint(ayConnected.get(0)); + byte unit1 = MapUtils.getMapColorAt(mapData, pt2.x, pt2.y); + + // 0: none 1: open door 2. unopen door 3: wither door 4. red door + Set<Tuple<Vector2d, EDungeonDoorType>> doorsAndStates = new HashSet<>(); + final int halfWidth = unitRoomDimension.width + 4; + for (Vector2d door : doors) { + int floorX = (int) Math.floor(door.x); + int floorY = (int) Math.floor(door.y); + Point mapPt = roomPointToMapPoint(new Point(floorX, floorY)); + Point target = new Point(mapPt.x + unitRoomDimension.width / 2 + (int) (halfWidth * (door.x - floorX)), mapPt.y + unitRoomDimension.height / 2 + (int) (halfWidth * (door.y - floorY))); + MapUtils.record(mapData, target.x, target.y, Color.green); + + byte color = MapUtils.getMapColorAt(mapData, target.x, target.y); + + Vector2d vector2d = new Vector2d(door.x - minX, door.y - minY); + + if (color == 0) { + doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.NONE)); + } else if (color == 85) { + doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.UNOPEN)); + } else if (color == 119) { + doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.WITHER)); + } else if (color == 18 && unit1 != 18) { + doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.BLOOD)); + } else { + doorsAndStates.add(new Tuple<>(vector2d, EDungeonDoorType.ENTRANCE)); + } + + } + + + return new DungeonRoom(ayConnected, shape, unit1, roomPointToWorldPoint(new Point(minX, minY)), roomPointToWorldPoint(new Point(maxX + 1, maxY + 1)).add(-1, 0, -1), context, doorsAndStates); + + } + + private boolean checkIfConnected(byte[] mapData, Point unitPoint1, Point unitPoint2) { + if (unitPoint1 == unitPoint2) return true; + if (unitPoint1.equals(unitPoint2)) return true; + + + Point high; + if (unitPoint2.y > unitPoint1.y) { + high = unitPoint2; + } else { + if (unitPoint2.x > unitPoint1.x) { + high = unitPoint2; + } else { + high = unitPoint1; + } + } + + Point low; + if (high == unitPoint2) { + low = unitPoint1; + } else { + low = unitPoint2; + } + + int xOff = low.x - high.x; + int yOff = low.y - high.y; + Point pt = roomPointToMapPoint(high); + Point pt2 = roomPointToMapPoint(low); + byte unit1 = MapUtils.getMapColorAt(mapData, pt.x, pt.y); + byte unit2 = MapUtils.getMapColorAt(mapData, pt2.x, pt2.y); + pt.translate(xOff, yOff); + byte unit3 = MapUtils.getMapColorAt(mapData, pt.x, pt.y); + + return unit1 == unit2 && unit2 == unit3 && unit1 != 0; + } + + public boolean isThereDifference(byte[] colorData, byte[] colorData1) { + + return true; +// boolean equals = Arrays.equals(colorData1, colorData); +// +// boolean foundDIffrentThen0 = false; +// +// +// for (byte colorDatum : colorData) { +// if(colorDatum != 0){ +// foundDIffrentThen0 = true; +// break; +// } +// } +// +// +// return !(equals && foundDIffrentThen0); + } + + private void processFinishedMap(byte[] mapData) { + if (MapUtils.getMapColorAt(mapData, 0, 0) == 0) { + return; + } + if (processed) { + return; + } + processed = true; + + MapUtils.clearMap(); + MapUtils.record(mapData, 0, 0, Color.GREEN); + + + FeatureRegistry.ETC_COLLECT_SCORE.collectDungeonRunData(mapData, context); + + } + + private void getPlayersFromMap(MapData mapdata) { + + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("Getting players from map"); + + for (Map.Entry<String, Vec4b> stringVec4bEntry : mapdata.mapDecorations.entrySet()) { + String mapDecString = stringVec4bEntry.getKey(); + Vec4b vec4 = stringVec4bEntry.getValue(); + + if (!mapIconToPlayerMap.containsValue(mapDecString)) { + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("mapIconToPlayerMap dosent have Player"); + + int x = vec4.func_176112_b() / 2 + 64; + int y = vec4.func_176113_c() / 2 + 64; + BlockPos mapPos = mapPointToWorldPoint(new Point(x, y)); + String potentialPlayer = null; + + for (String player : context.getPlayers()) { + if (DungeonsGuide.getDungeonsGuide().verbose) + logger.info("Player: {} isNear: {} ", player, isPlayerNear(player, mapPos)); +// if (!mapIconToPlayerMap.containsKey(player) && isPlayerNear(player, mapPos)) { + if (!mapIconToPlayerMap.containsKey(player)) { + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("Potential profile is: " + player); + potentialPlayer = player; + break; + } + } + + + if (potentialPlayer != null) { + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("potentialPlayer is not null"); + boolean shouldSave = true; + + for (Map.Entry<String, Vec4b> vec4bEntry : mapdata.mapDecorations.entrySet()) { +// String aaa = vec4bEntry.getKey(); + Vec4b bbb = vec4bEntry.getValue(); + +// if (mapIconToPlayerMap.containsValue(aaa) || mapDecString.equals(aaa)) { +// shouldSave = false; +// break; +// } +// else { + int x2 = bbb.func_176112_b() / 2 + 64; + int y2 = bbb.func_176113_c() / 2 + 64; + int dx = x2 - x; + int dy = y2 - y; + if (dx * dx + dy * dy < clossnessDistance) { + shouldSave = false; + break; + } +// } + } + + if (shouldSave) { + if (DungeonsGuide.getDungeonsGuide().verbose) + logger.info("added {} to mapIconPlayerMap with {}", potentialPlayer, stringVec4bEntry.getKey()); + if (mapIconToPlayerMap.containsKey(potentialPlayer)) { + mapIconToPlayerMap.replace(potentialPlayer, stringVec4bEntry.getKey()); + } else { + mapIconToPlayerMap.put(potentialPlayer, stringVec4bEntry.getKey()); + } + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("mapIconToPlayerMap:"); + if (DungeonsGuide.getDungeonsGuide().verbose) + mapIconToPlayerMap.forEach((key, value) -> logger.info(" {}: {}", key, value)); + } else { + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("shouldSave is false"); + } + + + } else { + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("potentialPlayer is null"); + } + + } else { + if (DungeonsGuide.getDungeonsGuide().verbose) logger.info("mapIconToPlayerMap has player "); + } + } + + + } + + private boolean isPlayerNear(String player, BlockPos mapPos) { + EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(player); + + if (entityPlayer != null && !entityPlayer.isInvisible()) { + BlockPos pos = entityPlayer.getPosition(); + int dx = mapPos.getX() - pos.getX(); + int dz = mapPos.getZ() - pos.getZ(); + return dx * dx + dz * dz < clossnessDistance; + + } + + return false; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/AbstractAction.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/AbstractAction.java index 4fd4056d..d465fd47 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/AbstractAction.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/AbstractAction.java @@ -16,42 +16,46 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -public abstract class AbstractAction implements Action { - @Override - public void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { +import java.util.Set; + +public abstract class AbstractAction { + public void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRouteProperties actionRouteProperties){ } - @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { } - @Override - public void onLivingDeath(DungeonRoom dungeonRoom, LivingDeathEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onLivingDeath(DungeonRoom dungeonRoom, LivingDeathEvent event, ActionRouteProperties actionRouteProperties) { } - @Override - public void onRenderScreen(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onRenderScreen(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties) { } - @Override - public void onLivingInteract(DungeonRoom dungeonRoom, PlayerInteractEntityEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onLivingInteract(DungeonRoom dungeonRoom, PlayerInteractEntityEvent event, ActionRouteProperties actionRouteProperties) { } - @Override - public void onTick(DungeonRoom dungeonRoom, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onTick(DungeonRoom dungeonRoom, ActionRouteProperties actionRouteProperties) { + + } + + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { + return null; + } + public boolean isComplete(DungeonRoom dungeonRoom) { + return false; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionBreakWithSuperBoom.java index 39d3e7ef..baab261f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionBreakWithSuperBoom.java @@ -16,13 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.GlStateManager; @@ -39,26 +40,27 @@ import java.util.HashSet; import java.util.Set; @Data +@EqualsAndHashCode(callSuper=false) public class ActionBreakWithSuperBoom extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<AbstractAction>(); private OffsetPoint target; - public ActionBreakWithSuperBoom(OffsetPoint target) { - this.target = target; - } - @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @Override public boolean isComplete(DungeonRoom dungeonRoom) { - return target.getBlock(dungeonRoom) == Blocks.air; + return false; + } + + public ActionBreakWithSuperBoom(OffsetPoint target) { + this.target = target; } @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); BlockPos blockpos = target.getBlockPos(dungeonRoom); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionChangeState.java index 56b27528..634129c6 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionChangeState.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonDummy; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonFairySoul; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.Data; import lombok.EqualsAndHashCode; @@ -30,9 +29,10 @@ import java.util.HashSet; import java.util.Set; @Data -public class ActionChangeState extends AbstractAction{ +@EqualsAndHashCode(callSuper=false) +public class ActionChangeState extends AbstractAction { @EqualsAndHashCode.Exclude - private Set<Action> preRequisite2 = new HashSet<Action>(); + private Set<AbstractAction> preRequisite2 = new HashSet<AbstractAction>(); private String mechanicName; private String state; @@ -43,9 +43,8 @@ public class ActionChangeState extends AbstractAction{ } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { - Set<Action> set = new HashSet<Action>(); - set.addAll(preRequisite2); + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { + Set<AbstractAction> set = new HashSet<>(preRequisite2); DungeonMechanic mechanic = dungeonRoom.getMechanics().get(mechanicName); if (mechanic!= null) set.addAll(mechanic.getAction(state, dungeonRoom)); @@ -59,14 +58,18 @@ public class ActionChangeState extends AbstractAction{ @Override public boolean isComplete(DungeonRoom dungeonRoom) { DungeonMechanic mechanic = dungeonRoom.getMechanics().get(mechanicName); - if (state.equalsIgnoreCase("navigate")) + if (state.equalsIgnoreCase("navigate")) { return true; - if (mechanic== null) + } + if (mechanic == null) { return false; - if (mechanic instanceof DungeonSecret && ((DungeonSecret) mechanic).getSecretType() != DungeonSecret.SecretType.CHEST) + } + if (mechanic instanceof DungeonSecret && ((DungeonSecret) mechanic).getSecretType() != DungeonSecret.SecretType.CHEST) { return true; - if (mechanic instanceof DungeonDummy) + } + if (mechanic instanceof DungeonDummy) { return true; + } return mechanic.getCurrentState(dungeonRoom).equalsIgnoreCase(state); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionClick.java index 1b463f2e..c9ffb81c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionClick.java @@ -16,15 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -34,8 +36,9 @@ import java.util.HashSet; import java.util.Set; @Data +@EqualsAndHashCode(callSuper=false) public class ActionClick extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<AbstractAction>(); private OffsetPoint target; private Predicate<ItemStack> predicate = Predicates.alwaysTrue(); @@ -46,7 +49,7 @@ public class ActionClick extends AbstractAction { } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @@ -56,15 +59,16 @@ public class ActionClick extends AbstractAction { } @Override - public void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRouteProperties actionRouteProperties) { if (clicked) return; if (target.getBlockPos(dungeonRoom).equals(event.pos) && (predicate == null || predicate.apply(event.entityLiving.getHeldItem()))) { clicked = true; + ChatTransmitter.sendDebugChat("ACTION FINISHED: CLICK"); } } @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { BlockPos pos = target.getBlockPos(dungeonRoom); RenderUtils.highlightBlock(pos, new Color(0, 255,255,50),partialTicks, true); RenderUtils.drawTextAtWorld("Click", pos.getX() + 0.5f, pos.getY() + 0.3f, pos.getZ() + 0.5f, 0xFFFFFF00, 0.02f, false, false, partialTicks); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionClickSet.java index 975c19e9..01f5b9b2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionClickSet.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -33,19 +32,21 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import java.awt.*; import java.util.HashSet; import java.util.Set; +import java.util.function.Predicate; @Data +@EqualsAndHashCode(callSuper=false) public class ActionClickSet extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<>(); private OffsetPointSet target; - private Predicate<ItemStack> predicate = Predicates.alwaysTrue(); + private Predicate<ItemStack> predicate = stack -> true; public ActionClickSet(OffsetPointSet target) { this.target = target; } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @@ -56,11 +57,10 @@ public class ActionClickSet extends AbstractAction { private boolean clicked = false; @Override - public void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onPlayerInteract(DungeonRoom dungeonRoom, PlayerInteractEvent event, ActionRouteProperties actionRouteProperties) { if (clicked) return; for (OffsetPoint pt2: target.getOffsetPointList()) { - if (pt2.getBlockPos(dungeonRoom).equals(event.pos) && - (predicate == null || predicate.apply(event.entityLiving.getHeldItem()))) { + if (pt2.getBlockPos(dungeonRoom).equals(event.pos) && predicate.test(event.entityLiving.getHeldItem())) { clicked = true; } } @@ -68,7 +68,7 @@ public class ActionClickSet extends AbstractAction { } @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { float xAcc = 0; float yAcc = 0; float zAcc = 0; @@ -83,7 +83,6 @@ public class ActionClickSet extends AbstractAction { RenderUtils.drawTextAtWorld("Click", xAcc / size, yAcc / size, zAcc / size, 0xFFFFFF00, 0.02f, false, false, partialTicks); } - @Override public boolean isComplete(DungeonRoom dungeonRoom) { return clicked; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionComplete.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionComplete.java index 3389ed62..32d6bfc3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionComplete.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionComplete.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import java.util.Collections; import java.util.Set; public class ActionComplete extends AbstractAction { @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return Collections.emptySet(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionDropItem.java index 2e90d3a3..0c94e5ae 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionDropItem.java @@ -16,15 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.entity.item.EntityItem; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; @@ -35,8 +36,9 @@ import java.util.List; import java.util.Set; @Data +@EqualsAndHashCode(callSuper = false) public class ActionDropItem extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<>(); private OffsetPoint target; private Predicate<EntityItem> predicate = Predicates.alwaysTrue(); @@ -45,27 +47,36 @@ public class ActionDropItem extends AbstractAction { } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @Override public boolean isComplete(DungeonRoom dungeonRoom) { - BlockPos pos = target.getBlockPos(dungeonRoom); + BlockPos secretLocation = target.getBlockPos(dungeonRoom); List<EntityItem> item = dungeonRoom.getContext().getWorld().getEntitiesWithinAABB(EntityItem.class, - AxisAlignedBB.fromBounds(pos.getX(), pos.getY(), pos.getZ(), pos.getX()+1, pos.getY() + 1, pos.getZ() + 1)); - if (item.size() == 0) return false; + AxisAlignedBB.fromBounds( + secretLocation.getX(), + secretLocation.getY(), + secretLocation.getZ(), + secretLocation.getX() + 1, + secretLocation.getY() + 1, + secretLocation.getZ() + 1)); + if (item.isEmpty()) { + return false; + } return (predicate == null || predicate.apply(item.get(0))); } @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { BlockPos pos = target.getBlockPos(dungeonRoom); - RenderUtils.highlightBlock(pos, new Color(0, 255,255,50),partialTicks, true); + RenderUtils.highlightBlock(pos, new Color(0, 255, 255, 50), partialTicks, true); RenderUtils.drawTextAtWorld("Drop Item", pos.getX() + 0.5f, pos.getY() + 0.3f, pos.getZ() + 0.5f, 0xFFFFFF00, 0.02f, false, false, partialTicks); } + @Override public String toString() { - return "DropItem\n- target: "+target.toString()+"\n- predicate: "+predicate.getClass().getSimpleName(); + return "DropItem\n- target: " + target.toString() + "\n- predicate: " + predicate.getClass().getSimpleName(); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionInteract.java index 3033754c..b41e1b7a 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionInteract.java @@ -16,17 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import kr.syeyoung.dungeonsguide.dungeon.DungeonActionManager; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonActionContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; @@ -34,12 +33,14 @@ import net.minecraft.util.Vec3; import java.awt.*; import java.util.HashSet; import java.util.Set; +import java.util.function.Predicate; @Data +@EqualsAndHashCode(callSuper=false) public class ActionInteract extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<>(); private OffsetPoint target; - private Predicate<Entity> predicate = Predicates.alwaysFalse(); + private Predicate<Entity> predicate = entity -> false; private int radius; public ActionInteract(OffsetPoint target) { @@ -47,7 +48,7 @@ public class ActionInteract extends AbstractAction { } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @@ -58,17 +59,24 @@ public class ActionInteract extends AbstractAction { private boolean interacted = false; @Override - public void onLivingInteract(DungeonRoom dungeonRoom, PlayerInteractEntityEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onLivingInteract(DungeonRoom dungeonRoom, PlayerInteractEntityEvent event, ActionRouteProperties actionRouteProperties) { if (interacted) return; - Vec3 spawnLoc = DungeonActionManager.getSpawnLocation().get(event.getEntity().getEntityId()); - if (spawnLoc == null) return; - if (target.getBlockPos(dungeonRoom).distanceSq(spawnLoc.xCoord, spawnLoc.yCoord, spawnLoc.zCoord) > radius * radius) return; - if (!predicate.apply(event.getEntity())) return; + Vec3 spawnLoc = DungeonActionContext.getSpawnLocation().get(event.getEntity().getEntityId()); + if (spawnLoc == null) { + return; + } + if (target.getBlockPos(dungeonRoom).distanceSq(spawnLoc.xCoord, spawnLoc.yCoord, spawnLoc.zCoord) > radius * radius) { + return; + } + if (!predicate.test(event.getEntity())) { + return; + } interacted = true; } + @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { BlockPos pos = target.getBlockPos(dungeonRoom); RenderUtils.highlightBlock(pos, new Color(0, 255,255,50),partialTicks, true); RenderUtils.drawTextAtWorld("Interact", pos.getX() + 0.5f, pos.getY() + 0.3f, pos.getZ() + 0.5f, 0xFFFFFF00, 0.02f, false, false, partialTicks); @@ -76,6 +84,6 @@ public class ActionInteract extends AbstractAction { @Override public String toString() { - return "InteractEntity\n- target: "+target.toString()+"\n- radius: "+radius+"\n- predicate: "+(predicate == null ? "null" : predicate.getClass().getSimpleName()); + return "InteractEntity\n- target: "+target.toString()+"\n- radius: "+radius+"\n- predicate: "+(predicate.test(null) ? "null" : predicate.getClass().getSimpleName()); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionKill.java index a08b81f0..94569ad1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionKill.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import kr.syeyoung.dungeonsguide.dungeon.DungeonActionManager; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonActionContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; @@ -34,12 +33,14 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent; import java.awt.*; import java.util.HashSet; import java.util.Set; +import java.util.function.Predicate; @Data +@EqualsAndHashCode(callSuper=false) public class ActionKill extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<AbstractAction>(); private OffsetPoint target; - private Predicate<Entity> predicate = Predicates.alwaysFalse(); + private Predicate<Entity> predicate = entity -> false; private int radius; public ActionKill(OffsetPoint target) { @@ -47,16 +48,16 @@ public class ActionKill extends AbstractAction { } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @Override public boolean isComplete(DungeonRoom dungeonRoom) { Vec3 spawn = new Vec3(target.getBlockPos(dungeonRoom)); - for (Integer killed : DungeonActionManager.getKilleds()) { - if (DungeonActionManager.getSpawnLocation().get(killed) == null) continue; - if (DungeonActionManager.getSpawnLocation().get(killed).squareDistanceTo(spawn) < 100) { + for (Integer killed : DungeonActionContext.getKilleds()) { + if (DungeonActionContext.getSpawnLocation().get(killed) == null) continue; + if (DungeonActionContext.getSpawnLocation().get(killed).squareDistanceTo(spawn) < 100) { return true; } } @@ -66,17 +67,17 @@ public class ActionKill extends AbstractAction { private boolean killed = false; @Override - public void onLivingDeath(DungeonRoom dungeonRoom, LivingDeathEvent event, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onLivingDeath(DungeonRoom dungeonRoom, LivingDeathEvent event, ActionRouteProperties actionRouteProperties) { if (killed) return; - Vec3 spawnLoc = DungeonActionManager.getSpawnLocation().get(event.entity.getEntityId()); + Vec3 spawnLoc = DungeonActionContext.getSpawnLocation().get(event.entity.getEntityId()); if (spawnLoc == null) return; if (target.getBlockPos(dungeonRoom).distanceSq(spawnLoc.xCoord, spawnLoc.yCoord, spawnLoc.zCoord) > radius * radius) return; - if (!predicate.apply(event.entity)) return; + if (!predicate.test(event.entity)) return; killed = true; } @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { BlockPos pos = target.getBlockPos(dungeonRoom); RenderUtils.highlightBlock(pos, new Color(0, 255,255,50),partialTicks, true); RenderUtils.drawTextAtWorld("Spawn", pos.getX() + 0.5f, pos.getY() + 0.3f, pos.getZ() + 0.5f, 0xFFFFFF00, 0.02f, false, false, partialTicks); @@ -84,6 +85,6 @@ public class ActionKill extends AbstractAction { @Override public String toString() { - return "KillEntity\n- target: "+target.toString()+"\n- radius: "+radius+"\n- predicate: "+(predicate == null ? "null" : predicate.getClass().getSimpleName()); + return "KillEntity\n- target: "+target.toString()+"\n- radius: "+radius+"\n- predicate: "+(predicate.test(null) ? "null" : predicate.getClass().getSimpleName()); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java index ec790489..f499032d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java @@ -16,30 +16,30 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.secret.FeatureTogglePathfind; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.client.Minecraft; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import java.util.HashSet; -import java.util.Set; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @Data +@EqualsAndHashCode(callSuper=false) public class ActionMove extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<>(); private OffsetPoint target; public ActionMove(OffsetPoint target) { @@ -47,7 +47,7 @@ public class ActionMove extends AbstractAction { } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @@ -57,7 +57,11 @@ public class ActionMove extends AbstractAction { } @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { + draw(dungeonRoom, partialTicks, actionRouteProperties, flag, target, poses); + } + + static void draw(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag, OffsetPoint target, List<Vec3> poses) { BlockPos pos = target.getBlockPos(dungeonRoom); float distance = MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition())); @@ -66,10 +70,14 @@ public class ActionMove extends AbstractAction { float scale = 0.45f * multiplier; scale *= 25.0 / 6.0; if (actionRouteProperties.isBeacon()) { - RenderUtils.renderBeaconBeam(pos.getX(), pos.getY(), pos.getZ(), actionRouteProperties.getBeaconBeamColor(), partialTicks); + if(!FeatureRegistry.RENDER_BREACONS.isEnabled()){ + RenderUtils.renderBeaconBeam(pos.getX(), pos.getY(), pos.getZ(), actionRouteProperties.getBeaconBeamColor(), partialTicks); + } RenderUtils.highlightBlock(pos, actionRouteProperties.getBeaconColor(), partialTicks); } - RenderUtils.drawTextAtWorld("Destination", pos.getX() + 0.5f, pos.getY() + 0.5f + scale, pos.getZ() + 0.5f, 0xFF00FF00, flag ? 2f : 1f, true, false, partialTicks); + if(!FeatureRegistry.RENDER_DESTENATION_TEXT.isEnabled()){ + RenderUtils.drawTextAtWorld("Destination", pos.getX() + 0.5f, pos.getY() + 0.5f + scale, pos.getZ() + 0.5f, 0xFF00FF00, flag ? 2f : 1f, true, false, partialTicks); + } RenderUtils.drawTextAtWorld(String.format("%.2f",MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition())))+"m", pos.getX() + 0.5f, pos.getY() + 0.5f - scale, pos.getZ() + 0.5f, 0xFFFFFF00, flag ? 2f : 1f, true, false, partialTicks); if (!FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() || !FeatureRegistry.SECRET_TOGGLE_KEY.togglePathfindStatus) { @@ -84,7 +92,7 @@ public class ActionMove extends AbstractAction { private Future<List<Vec3>> latestFuture; @Override - public void onTick(DungeonRoom dungeonRoom, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onTick(DungeonRoom dungeonRoom, ActionRouteProperties actionRouteProperties) { tick = (tick+1) % Math.max(1, actionRouteProperties.getLineRefreshRate()); if (latestFuture != null && latestFuture.isDone()) { try { @@ -96,16 +104,16 @@ public class ActionMove extends AbstractAction { } if (tick == 0 && actionRouteProperties.isPathfind() && latestFuture == null) { - if (!FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() || poses == null) + if (!FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() || poses == null) { latestFuture = dungeonRoom.createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE, 10000); + } } } public void forceRefresh(DungeonRoom dungeonRoom) { - try { - if (latestFuture != null) return; - } catch (Exception ignored) {} - latestFuture = dungeonRoom.createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE, 10000); + if (latestFuture == null) { + latestFuture = dungeonRoom.createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE, 10000); + } } @Override public String toString() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java index 14897147..54e8b1a8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMoveNearestAir.java @@ -16,18 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.client.Minecraft; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import java.util.HashSet; @@ -37,8 +34,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @Data +@EqualsAndHashCode(callSuper=false) public class ActionMoveNearestAir extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); + private Set<AbstractAction> preRequisite = new HashSet<>(); private OffsetPoint target; public ActionMoveNearestAir(OffsetPoint target) { @@ -46,7 +44,7 @@ public class ActionMoveNearestAir extends AbstractAction { } @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } @@ -54,35 +52,16 @@ public class ActionMoveNearestAir extends AbstractAction { public boolean isComplete(DungeonRoom dungeonRoom) { return target.getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) < 25; } - @Override - public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRoute.ActionRouteProperties actionRouteProperties, boolean flag) { - BlockPos pos = target.getBlockPos(dungeonRoom); - - float distance = MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition())); - float multiplier = distance / 120f; //mobs only render ~120 blocks away - if (flag) multiplier *= 2.0f; - float scale = 0.45f * multiplier; - scale *= 25.0 / 6.0; - if (actionRouteProperties.isBeacon()) { - RenderUtils.renderBeaconBeam(pos.getX(), pos.getY(), pos.getZ(), actionRouteProperties.getBeaconBeamColor(), partialTicks); - RenderUtils.highlightBlock(pos, actionRouteProperties.getBeaconColor(), partialTicks); - } - RenderUtils.drawTextAtWorld("Destination", pos.getX() + 0.5f, pos.getY() + 0.5f + scale, pos.getZ() + 0.5f, 0xFF00FF00, flag ? 2f : 1f, true, false, partialTicks); - RenderUtils.drawTextAtWorld(String.format("%.2f",MathHelper.sqrt_double(pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition())))+"m", pos.getX() + 0.5f, pos.getY() + 0.5f - scale, pos.getZ() + 0.5f, 0xFFFFFF00, flag ? 2f : 1f, true, false, partialTicks); - - if (!FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() || !FeatureRegistry.SECRET_TOGGLE_KEY.togglePathfindStatus) { - if (poses != null){ - RenderUtils.drawLinesVec3(poses, actionRouteProperties.getLineColor(), actionRouteProperties.getLineWidth(), partialTicks, true); - } - } + public void onRenderWorld(DungeonRoom dungeonRoom, float partialTicks, ActionRouteProperties actionRouteProperties, boolean flag) { + ActionMove.draw(dungeonRoom, partialTicks, actionRouteProperties, flag, target, poses); } private int tick = -1; private List<Vec3> poses; private Future<List<Vec3>> latestFuture; @Override - public void onTick(DungeonRoom dungeonRoom, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void onTick(DungeonRoom dungeonRoom, ActionRouteProperties actionRouteProperties) { tick = (tick+1) % Math.max(1, actionRouteProperties.getLineRefreshRate()); if (latestFuture != null && latestFuture.isDone()) { try { @@ -94,17 +73,17 @@ public class ActionMoveNearestAir extends AbstractAction { } if (tick == 0 && actionRouteProperties.isPathfind() && latestFuture == null) { - if (!FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() || poses == null) + if (!FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() || poses == null) { latestFuture = dungeonRoom.createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE, 10000); + } } } public void forceRefresh(DungeonRoom dungeonRoom) { - try { - if (latestFuture != null) return; - } catch (Exception ignored) {} - latestFuture = dungeonRoom.createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE, 10000); + if (latestFuture == null) { + latestFuture = dungeonRoom.createEntityPathTo(dungeonRoom.getContext().getWorld(), Minecraft.getMinecraft().thePlayer, target.getBlockPos(dungeonRoom), Integer.MAX_VALUE, 10000); + } } @Override public String toString() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionRoot.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionRoot.java index 39c7fa6c..23b9fdce 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionRoot.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionRoot.java @@ -16,23 +16,22 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.Data; +import lombok.EqualsAndHashCode; import java.util.HashSet; import java.util.Set; @Data +@EqualsAndHashCode(callSuper=false) public class ActionRoot extends AbstractAction { - private Set<Action> preRequisite = new HashSet<Action>(); - - public ActionRoot() { - } + private Set<AbstractAction> preRequisite = new HashSet<>(); @Override - public Set<Action> getPreRequisites(DungeonRoom dungeonRoom) { + public Set<AbstractAction> getPreRequisites(DungeonRoom dungeonRoom) { return preRequisite; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRoute.java index 3580dd03..17cea18d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRoute.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions.tree; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.actions.*; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import lombok.Data; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraftforge.event.entity.living.LivingDeathEvent; @@ -39,7 +38,7 @@ public class ActionRoute { @Getter private int current; @Getter - private final List<Action> actions; + private final List<AbstractAction> actions; private final DungeonRoom dungeonRoom; @@ -51,27 +50,40 @@ public class ActionRoute { this.state = state; this.actionRouteProperties = actionRouteProperties; + System.out.println("Creating Action Route with mechanic:" + mechanic + " State:" + state); ActionChangeState actionChangeState = new ActionChangeState(mechanic, state); ActionTree tree= ActionTree.buildActionTree(actionChangeState, dungeonRoom); actions = ActionTreeUtil.linearifyActionTree(tree); actions.add(new ActionComplete()); + ChatTransmitter.sendDebugChat("Created ActionRoute with " + actions.size() + " steps"); + ChatTransmitter.sendDebugChat("========== STEPS =========="); + for (AbstractAction action : actions) { + ChatTransmitter.sendDebugChat(action.toString()); + } + ChatTransmitter.sendDebugChat("=========== END ==========="); + + current = 0; this.dungeonRoom = dungeonRoom; } - public Action next() { + public AbstractAction next() { current ++; - if (current >= actions.size()) current = actions.size() - 1; - return actions.get(current); + if (current >= actions.size()) { + current = actions.size() - 1; + } + return getCurrentAction(); } - public Action prev() { + public AbstractAction prev() { current --; - if (current < 0) current = 0; - return actions.get(current); + if (current < 0) { + current = 0; + } + return getCurrentAction(); } - public Action getCurrentAction() { + public AbstractAction getCurrentAction() { return actions.get(current); } @@ -84,9 +96,17 @@ public class ActionRoute { getCurrentAction().onLivingDeath(dungeonRoom, event, actionRouteProperties ); } public void onRenderWorld(float partialTicks, boolean flag) { - if (current -1 >= 0 && ( - (actions.get(current-1) instanceof ActionMove && ((ActionMove) actions.get(current-1)).getTarget().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) >= 25) - || (actions.get(current-1) instanceof ActionMoveNearestAir && ((ActionMoveNearestAir) actions.get(current-1)).getTarget().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) >= 25))) actions.get(current-1).onRenderWorld(dungeonRoom, partialTicks, actionRouteProperties, flag ); + + if (current -1 >= 0) { + AbstractAction abstractAction = actions.get(current - 1); + if(((abstractAction instanceof ActionMove && ((ActionMove) abstractAction).getTarget().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) >= 25) + || (abstractAction instanceof ActionMoveNearestAir && ((ActionMoveNearestAir) abstractAction).getTarget().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) >= 25))){ + abstractAction.onRenderWorld(dungeonRoom, partialTicks, actionRouteProperties, flag ); + } + } + getCurrentAction().onRenderWorld(dungeonRoom, partialTicks, actionRouteProperties, flag); + + getCurrentAction().onRenderWorld(dungeonRoom, partialTicks, actionRouteProperties, flag); } @@ -95,30 +115,22 @@ public class ActionRoute { } public void onTick() { - Action current = getCurrentAction(); + AbstractAction currentAction = getCurrentAction(); - current.onTick(dungeonRoom, actionRouteProperties); + currentAction.onTick(dungeonRoom, actionRouteProperties); if (this.current -1 >= 0 && (actions.get(this.current-1) instanceof ActionMove || actions.get(this.current-1) instanceof ActionMoveNearestAir)) actions.get(this.current-1).onTick(dungeonRoom, actionRouteProperties ); if (dungeonRoom.getMechanics().get(mechanic).getCurrentState(dungeonRoom).equals(state)) { this.current = actions.size() - 1; } - if (current.isComplete(dungeonRoom)) + if (currentAction.isComplete(dungeonRoom)) { next(); + } } - public void onLivingInteract(PlayerInteractEntityEvent event) { getCurrentAction().onLivingInteract(dungeonRoom, event, actionRouteProperties ); } - - @Data - public static class ActionRouteProperties { - private boolean pathfind; - private int lineRefreshRate; - private AColor lineColor; - private float lineWidth; - - private boolean beacon; - private AColor beaconColor; - private AColor beaconBeamColor; + public void onLivingInteract(PlayerInteractEntityEvent event) { + getCurrentAction().onLivingInteract(dungeonRoom, event, actionRouteProperties ); } + } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java new file mode 100644 index 00000000..df32e718 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java @@ -0,0 +1,16 @@ +package kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import lombok.Data; + +@Data +public class ActionRouteProperties { + private boolean pathfind; + private int lineRefreshRate; + private AColor lineColor; + private float lineWidth; + + private boolean beacon; + private AColor beaconColor; + private AColor beaconBeamColor; +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionTree.java index 3139ce73..99846fc7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionTree.java @@ -16,51 +16,55 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions.tree; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionRoot; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionRoot; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.Data; import lombok.EqualsAndHashCode; +import org.jetbrains.annotations.NotNull; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import java.util.*; @Data public class ActionTree implements Cloneable { @EqualsAndHashCode.Exclude private Set<ActionTree> parent; - private Action current; + private AbstractAction current; private Set<ActionTree> children; @Override public int hashCode() { return current == null ? 0 : current.hashCode(); } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ActionTree that = (ActionTree) o; + return Objects.equals(parent, that.parent) && Objects.equals(current, that.current) && Objects.equals(children, that.children); + } - public static ActionTree buildActionTree(Set<Action> actions, DungeonRoom dungeonRoom) { + public static ActionTree buildActionTree(Set<AbstractAction> actions, DungeonRoom dungeonRoom) { ActionRoot root = new ActionRoot(); root.setPreRequisite(actions); ActionTree tree = new ActionTree(); - tree.setParent(new HashSet<ActionTree>()); + tree.setParent(new HashSet<>()); tree.setCurrent(root); - HashSet<ActionTree> set = new HashSet(); - for (Action action : actions) { - set.add(buildActionTree(tree, action, dungeonRoom, new HashMap<Action, ActionTree>())); + HashSet<ActionTree> set = new HashSet<>(); + for (AbstractAction action : actions) { + set.add(buildActionTree(tree, action, dungeonRoom, new HashMap<>())); } tree.setChildren(set); return tree; } - public static ActionTree buildActionTree(Action actions, DungeonRoom dungeonRoom) { - return buildActionTree(null, actions, dungeonRoom, new HashMap<Action, ActionTree>()); + public static ActionTree buildActionTree(AbstractAction actions, DungeonRoom dungeonRoom) { + return buildActionTree(null, actions, dungeonRoom, new HashMap<>()); } - private static ActionTree buildActionTree(ActionTree parent, Action action, DungeonRoom dungeonRoom, Map<Action, ActionTree> alreadyBuilt) { - if (action == null) return null; + private static ActionTree buildActionTree(ActionTree parent, @NotNull AbstractAction action,@NotNull DungeonRoom dungeonRoom, @NotNull Map<AbstractAction, ActionTree> alreadyBuilt) { if (alreadyBuilt.containsKey(action)) { ActionTree tree = alreadyBuilt.get(action); tree.getParent().add(parent); @@ -69,14 +73,21 @@ public class ActionTree implements Cloneable { ActionTree tree = new ActionTree(); alreadyBuilt.put(action, tree); - tree.setParent(new HashSet<ActionTree>()); - if (parent != null) + tree.setParent(new HashSet<>()); + if (parent != null) { tree.getParent().add(parent); + } tree.setCurrent(action); - HashSet<ActionTree> set = new HashSet(); - for (Action action2 : action.getPreRequisites(dungeonRoom)) { - set.add(buildActionTree(tree, action2, dungeonRoom, alreadyBuilt)); + HashSet<ActionTree> set = new HashSet<>(); + + Set<AbstractAction> preRequisites = action.getPreRequisites(dungeonRoom); + if(preRequisites != null){ + for (AbstractAction action2 : preRequisites) { + ActionTree e = buildActionTree(tree, action2, dungeonRoom, alreadyBuilt); + set.add(e); + } } + tree.setChildren(set); return tree; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTreeUtil.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionTreeUtil.java index b0ffd2dc..18c17c17 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTreeUtil.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionTreeUtil.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.actions.tree; +package kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; import java.util.*; public class ActionTreeUtil { - public static List<Action> linearifyActionTree(ActionTree input) { + public static List<AbstractAction> linearifyActionTree(ActionTree input) { ActionTree tree = copyActionTree(input); - List<Action> actions = new ArrayList<Action>(); + List<AbstractAction> actions = new ArrayList<AbstractAction>(); int plsHalt = 0; while (tree.getChildren().size() != 0) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonDoor.java index 9a52dad8..15004dcc 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonDoor.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.doorfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder; import com.google.common.collect.Sets; import lombok.Getter; @@ -31,7 +31,7 @@ import java.util.Set; public class DungeonDoor { private final World w; private final BlockPos position; - private EDungeonDoorType type; + private final EDungeonDoorType type; private boolean isZDir; private static final Set<Block> legalBlocks = Sets.newHashSet(Blocks.coal_block, Blocks.barrier, Blocks.monster_egg, Blocks.air, Blocks.stained_hardened_clay); @@ -45,33 +45,39 @@ public class DungeonDoor { this.type = type; boolean exist = type.isExist(); - for (int x = -1; x<=1; x++) - for (int y = -1; y<=1; y++) + for (int x = -1; x<=1; x++) { + for (int y = -1; y<=1; y++) { for (int z = -1; z<=1; z++) { BlockPos pos2 = pos.add(x,y,z); Block block = world.getChunkFromBlockCoords(pos2).getBlock(pos2); if (itshouldbeall != block) exist = false; } + } + } if (exist) { BlockPos ZCheck = pos.add(0,0,2); isZDir = world.getChunkFromBlockCoords(ZCheck).getBlock(ZCheck) == Blocks.air; if (isZDir) { - for (int x = -1; x<=1; x++) - for (int y = -1; y<=1; y++) + for (int x = -1; x<=1; x++) { + for (int y = -1; y<=1; y++) { for (int z = -2; z<=2; z+=4) { BlockPos pos2 = pos.add(x,y,z); Block block = world.getChunkFromBlockCoords(pos2).getBlock(pos2); if (block != Blocks.air) exist = false; } + } + } } else { - for (int x = -2; x<=2; x+=4) - for (int y = -1; y<=1; y++) + for (int x = -2; x<=2; x+=4) { + for (int y = -1; y<=1; y++) { for (int z = -1; z<=1; z++) { BlockPos pos2 = pos.add(x,y,z); Block block = world.getChunkFromBlockCoords(pos2).getBlock(pos2); if (block != Blocks.air) exist = false; } + } + } } } if (!exist) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonSpecificDataProvider.java index dfdd0e3e..b34986eb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonSpecificDataProvider.java @@ -16,19 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.doorfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessor; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import javax.vecmath.Vector2d; public interface DungeonSpecificDataProvider { + BlockPos findDoor(World w, String dungeonName); - Vector2d findDoorOffset(World w, String dungeonName); + Vector2d findDoorOffset(World w, String dungeonName); BossfightProcessor createBossfightProcessor(World w, String dungeonName); boolean isTrapSpawn(String dungeonName); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java index 3753e6ca..48b24120 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java @@ -16,18 +16,21 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.doorfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder; + +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs.impl.NormalModeDataProvider; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs.impl.MasterModeDataProvider; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; public class DungeonSpecificDataProviderRegistry { - public static final Map<Pattern, DungeonSpecificDataProvider> doorFinders = new HashMap<Pattern, DungeonSpecificDataProvider>(); + public static final Map<Pattern, DungeonSpecificDataProvider> doorFinders = new HashMap<>(); static { - doorFinders.put(Pattern.compile("The Catacombs (?:F[0-9]|E)"), new CatacombDataProvider()); - doorFinders.put(Pattern.compile("The Catacombs (?:M[0-9])"), new CatacombMasterDataProvider()); + doorFinders.put(Pattern.compile("The Catacombs (?:F[0-9]|E)"), new NormalModeDataProvider()); + doorFinders.put(Pattern.compile("The Catacombs (?:M[0-9])"), new MasterModeDataProvider()); } public static DungeonSpecificDataProvider getDoorFinder(String dungeonName) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/EDungeonDoorType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/EDungeonDoorType.java index 3a07629e..05915a1a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/EDungeonDoorType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/EDungeonDoorType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.doorfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder; import lombok.AllArgsConstructor; import lombok.Getter; @@ -24,10 +24,15 @@ import lombok.Getter; @AllArgsConstructor @Getter public enum EDungeonDoorType { - NONE(false, false, false,"?"), ENTRANCE(true, false, false, "entrance"), WITHER(true, true,true,"withergate"),WITHER_FAIRY(true, false,true,"wither-fairy-gate"), BLOOD(true, true,true, "bloodgate"), UNOPEN(true, false, false,"gate"); + NONE(false, false, false,"?"), ENTRANCE(true, false, false, "entrance"), + WITHER(true, true,true,"withergate"), + WITHER_FAIRY(true, false,true,"wither-fairy-gate"), + BLOOD(true, true,true, "bloodgate"), + UNOPEN(true, false, false,"gate"); - private boolean exist; - private boolean keyRequired; - private boolean headToBlood; - private String name; + + private final boolean exist; + private final boolean keyRequired; + private final boolean headToBlood; + private final String name; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/CatacombsDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/CatacombsDataProvider.java new file mode 100644 index 00000000..b9052353 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/CatacombsDataProvider.java @@ -0,0 +1,75 @@ +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs; + +import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProvider; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +import javax.vecmath.Vector2d; +import java.util.Collection; +import java.util.Set; + +public abstract class CatacombsDataProvider implements DungeonSpecificDataProvider { + + private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0,1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1 , 0)); + + @Nullable + static Vector2d getVector2d(World w, Collection<EntityArmorStand> armorStand, Set<Vector2d> directions) { + EntityArmorStand mort = armorStand.iterator().next(); + BlockPos pos = mort.getPosition(); + pos = pos.add(0, 3, 0); + for (int i = 0; i < 5; i++) { + for (Vector2d vector2d: directions) { + BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); + if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { + return vector2d; + } + } + } + return null; + } + + public static Collection<EntityArmorStand> getMorts(World w){ + return w.getEntities(EntityArmorStand.class, input -> input.getName().equals("§bMort")); + } + + /** + * This gets all morts checks for iron bars near him + * and based on iron bars determine the door location + * + * @param w World that we are going to look for the door in + * world is explicitly specified instead of mc.theWorld bc we can use cached worlds + * @param dungeonName dungeon type eg master mode, currently unused + * @return Block pos of the dungeon entrance + */ + public BlockPos findDoor(World w, String dungeonName) { + Collection<EntityArmorStand> armorStand = getMorts(w); + + if (!armorStand.isEmpty()) { + EntityArmorStand mort = armorStand.iterator().next(); + BlockPos pos = mort.getPosition(); + pos = pos.add(0, 3, 0); + for (int i = 0; i < 5; i++) { + for (Vector2d vector2d:directions) { + BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); + if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { + return pos.add(vector2d.x * (i + 2), -2, vector2d.y * (i+2)); + } + } + } + } + return null; + } + + public Vector2d findDoorOffset(World w, String dungeonName) { + Collection<EntityArmorStand> armorStand = getMorts(w); + + if (!armorStand.isEmpty()) { + return getVector2d(w, armorStand, directions); + } + return null; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/MasterModeDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/MasterModeDataProvider.java new file mode 100755 index 00000000..ab3f5df3 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/MasterModeDataProvider.java @@ -0,0 +1,64 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs.impl; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs.CatacombsDataProvider; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorLivid; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + +public class MasterModeDataProvider extends CatacombsDataProvider { + + + @Override + public BossfightProcessor createBossfightProcessor(World w, String dungeonName) { + String floor = dungeonName.substring(14).trim(); + ChatTransmitter.sendDebugChat(new ChatComponentText("Floor: Master mode "+floor+ " Building bossfight processor")); + if (floor.equals("M5")) { + return new BossfightProcessorLivid(true); + } + return null; + } + + @Override + public boolean isTrapSpawn(String dungeonName) { + String floor = dungeonName.substring(14).trim(); + switch (floor) { + case "M3": + case "M4": + case "M5": + case "M6": + return true; + default: + return floor.equals("M7"); + } + } + + @Override + public double secretPercentage(String dungeonName) { + return 1.0; + } + + @Override + public int speedSecond(String dungeonName) { + return 480; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/NormalModeDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/NormalModeDataProvider.java new file mode 100755 index 00000000..880cf473 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/doorfinder/catacombs/impl/NormalModeDataProvider.java @@ -0,0 +1,101 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs.impl; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.catacombs.CatacombsDataProvider; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.*; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + +public class NormalModeDataProvider extends CatacombsDataProvider { + + + @Override + public BossfightProcessor createBossfightProcessor(World w, String dungeonName) { + String floor = dungeonName.substring(14).trim(); + ChatTransmitter.sendDebugChat(new ChatComponentText("Floor: "+floor+ " Building bossfight processor")); + switch (floor) { + case "F1": + return new BossfightProcessorBonzo(); + case "F2": + return new BossfightProcessorScarf(); + case "F3": + return new BossfightProcessorProf(); + case "F4": + return new BossfightProcessorThorn(); + case "F5": + return new BossfightProcessorLivid(false); + case "F6": + return new BossfightProcessorSadan(); + case "F7": + return new BossfightProcessorNecron(); + default: + return null; + } + } + + @Override + public boolean isTrapSpawn(String dungeonName) { + String floor = dungeonName.substring(14).trim(); + switch (floor) { + case "F3": + case "F4": + case "F5": + case "F6": + return true; + default: + return floor.equals("F7"); + } + } + + @Override + public double secretPercentage(String dungeonName) { + String floor = dungeonName.substring(14).trim(); + switch (floor) { + case "F1": + case "E": + return 0.3; + case "F2": + return 0.4; + case "F3": + return 0.5; + case "F4": + return 0.6; + case "F5": + return 0.7; + case "F6": + return 0.85; + default: + return 1.0; + } + } + + @Override + public int speedSecond(String dungeonName) { + String floor = dungeonName.substring(14).trim(); + switch (floor) { + case "F5": + case "F7": + return 720; + default: + return 600; + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEvent.java index 3ba6a2e8..0e71a65e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEvent.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import lombok.Data; import java.io.Serializable; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEventData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEventData.java index 8883380a..812e1488 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEventData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEventData.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events; import java.io.Serializable; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEventHolder.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEventHolder.java index 4216e11b..58799f80 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonEventHolder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/DungeonEventHolder.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/SerializableBlockPos.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/SerializableBlockPos.java index ab1031e7..d70ba2c2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/SerializableBlockPos.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/SerializableBlockPos.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events; import lombok.AllArgsConstructor; import lombok.Data; @@ -26,7 +26,9 @@ import java.io.Serializable; @Data @AllArgsConstructor public class SerializableBlockPos implements Serializable { - private int x, y, z; + private int x; + private int y; + private int z; public SerializableBlockPos(BlockPos pos) { this.x = pos.getX(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonCryptBrokenEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonCryptBrokenEvent.java index 6c4b02b8..c2a4f71e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonCryptBrokenEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonCryptBrokenEvent.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; import lombok.AllArgsConstructor; import lombok.Data; -import java.awt.*; - @Data @AllArgsConstructor public class DungeonCryptBrokenEvent implements DungeonEventData { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonDeathEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonDeathEvent.java index 7e1dea89..09877b80 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonDeathEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonDeathEvent.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; import lombok.AllArgsConstructor; import lombok.Data; -import java.awt.*; - @Data @AllArgsConstructor public class DungeonDeathEvent implements DungeonEventData { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonMapUpdateEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonMapUpdateEvent.java index 27969582..023902c8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonMapUpdateEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonMapUpdateEvent.java @@ -16,8 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonNodataEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonNodataEvent.java index 4a355498..531f5990 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonNodataEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonNodataEvent.java @@ -16,8 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonPuzzleFailureEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonPuzzleFailureEvent.java index 44fa40c1..64621339 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonPuzzleFailureEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonPuzzleFailureEvent.java @@ -16,8 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonRoomDiscoverEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonRoomDiscoverEvent.java index 9e8b74ce..09fd64a5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonRoomDiscoverEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonRoomDiscoverEvent.java @@ -16,11 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.SerializableBlockPos; import lombok.AllArgsConstructor; import lombok.Data; -import net.minecraft.util.BlockPos; import java.awt.*; import java.util.UUID; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonSecretCountChangeEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonSecretCountChangeEvent.java index fd96e261..21ea853c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonSecretCountChangeEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonSecretCountChangeEvent.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; import lombok.AllArgsConstructor; import lombok.Data; -import java.awt.*; - @Data @AllArgsConstructor public class DungeonSecretCountChangeEvent implements DungeonEventData { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonStateChangeEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonStateChangeEvent.java index 34676e02..f1cb1167 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/events/DungeonStateChangeEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/events/impl/DungeonStateChangeEvent.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.events; +package kr.syeyoung.dungeonsguide.mod.dungeon.events.impl; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.DungeonEventData; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.AllArgsConstructor; import lombok.Data; -import net.minecraft.util.BlockPos; import java.awt.*; -import java.util.UUID; @Data @AllArgsConstructor diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/map/DungeonMapData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/map/DungeonMapData.java new file mode 100644 index 00000000..9687d554 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/map/DungeonMapData.java @@ -0,0 +1,121 @@ +package kr.syeyoung.dungeonsguide.mod.dungeon.map; + +import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.MapProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProvider; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonSpecificDataProviderRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonNodataEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonContextInitializationEvent; +import kr.syeyoung.dungeonsguide.mod.utils.MapUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraftforge.common.MinecraftForge; + +import javax.vecmath.Vector2d; +import java.awt.*; +import java.util.Set; + +public class DungeonMapData { + private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0, 1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1, 0)); + private static final Set<Vector2d> door_dirs = Sets.newHashSet(new Vector2d(0, 0.5), new Vector2d(0, -0.5), new Vector2d(0.5, 0), new Vector2d(-0.5, 0)); + public Dimension unitRoomDimension; + public boolean bugged; + public Dimension doorDimensions; + public Point topLeftMapPoint; + private final DungeonContext context; + private final Minecraft mc; + public boolean initialized; + + public DungeonMapData(DungeonContext context, Minecraft mc) { + this.context = context; + this.mc = mc; + } + + + public void eat(final byte[] mapData){ + final Point firstRoom = MapUtils.findFirstColorWithIn(mapData, (byte) 30, new Rectangle(0, 0, 128, 128)); + // Determine room dimension + int width = MapUtils.getWidthOfColorAt(mapData, (byte) 30, firstRoom); + int height = MapUtils.getHeightOfColorAt(mapData, (byte) 30, firstRoom); + unitRoomDimension = new Dimension(width, height); + Vector2d doorDir = null; + Point midfirstRoom = new Point(firstRoom.x + unitRoomDimension.width / 2, firstRoom.y + unitRoomDimension.height / 2); + final int halfWidth = unitRoomDimension.width / 2 + 2; + for (Vector2d v : directions) { + byte color = MapUtils.getMapColorAt(mapData, (int) (v.x * halfWidth + midfirstRoom.x), (int) (v.y * halfWidth + midfirstRoom.y)); + if (color != 0) { + doorDir = v; + break; + } + } + + if (doorDir == null) { + bugged = true; + return; + } + + Point basePoint = new Point(firstRoom.x, firstRoom.y); + if (doorDir.x > 0) basePoint.x += unitRoomDimension.width; + if (doorDir.x < 0) basePoint.x -= 1; + if (doorDir.y > 0) basePoint.y += unitRoomDimension.height; + if (doorDir.y < 0) basePoint.y -= 1; + int gap = MapUtils.getLengthOfColorExtending(mapData, (byte) 0, basePoint, doorDir); + Point pt = MapUtils.findFirstColorWithInNegate(mapData, (byte) 0, new Rectangle(basePoint.x, basePoint.y, (int) Math.abs(doorDir.y) * unitRoomDimension.width + 1, (int) Math.abs(doorDir.x) * unitRoomDimension.height + 1)); + if (pt == null) { + bugged = true; + return; + } + int doorWidth = MapUtils.getLengthOfColorExtending(mapData, MapUtils.getMapColorAt(mapData, pt.x, pt.y), pt, new Vector2d((int) Math.abs(doorDir.y), (int) Math.abs(doorDir.x))); + doorDimensions = new Dimension(doorWidth, gap); + + // Determine Top Left + int topLeftX = firstRoom.x; + int topLeftY = firstRoom.y; + while (topLeftX >= unitRoomDimension.width + doorDimensions.height) + topLeftX -= unitRoomDimension.width + doorDimensions.height; + while (topLeftY >= unitRoomDimension.height + doorDimensions.height) + topLeftY -= unitRoomDimension.height + doorDimensions.height; + topLeftMapPoint = new Point(topLeftX, topLeftY); + // determine door location based on npc, and determine map min from there + DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(DungeonContext.getDungeonName()); + if (doorFinder == null) { + bugged = true; + return; + } + BlockPos door = doorFinder.findDoor(mc.theWorld, DungeonContext.getDungeonName()); + if (door == null) { + bugged = true; + return; + } + + ChatTransmitter.sendDebugChat(new ChatComponentText("door Pos:" + door)); + + Point unitPoint = MapProcessor.mapPointToRoomPoint(firstRoom, topLeftMapPoint, unitRoomDimension, doorDimensions); + unitPoint.translate(unitPoint.x + 1, unitPoint.y + 1); + unitPoint.translate((int) doorDir.x, (int) doorDir.y); + + Vector2d offset = doorFinder.findDoorOffset(mc.theWorld, DungeonContext.getDungeonName()); + boolean axisMatch = doorDir.equals(offset); + + int worldX = unitPoint.x * 16; + int worldY = unitPoint.y * 16; + BlockPos worldMin = door.add(-worldX, 0, -worldY); + context.setDungeonMin(worldMin); + + ChatTransmitter.sendDebugChat(new ChatComponentText("Found Green room:" + firstRoom)); + ChatTransmitter.sendDebugChat(new ChatComponentText("Axis match:" + axisMatch)); + ChatTransmitter.sendDebugChat(new ChatComponentText("World Min:" + context.getDungeonMin())); + ChatTransmitter.sendDebugChat(new ChatComponentText("Dimension:" + unitRoomDimension)); + ChatTransmitter.sendDebugChat(new ChatComponentText("top Left:" + topLeftMapPoint)); + ChatTransmitter.sendDebugChat(new ChatComponentText("door dimension:" + doorDimensions)); + context.createEvent(new DungeonNodataEvent("MAP_PROCESSOR_INIT")); + initialized = true; + MinecraftForge.EVENT_BUS.post(new DungeonContextInitializationEvent()); + + + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/AStarCornerCut.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/AStarCornerCut.java index ee71f90b..f6ac1777 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/AStarCornerCut.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/AStarCornerCut.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.pathfinding; +package kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/AStarFineGrid.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/AStarFineGrid.java index 94fa8a87..8cb49a10 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/AStarFineGrid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/AStarFineGrid.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.pathfinding; +package kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/CachedWorld.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/CachedWorld.java index ac9234c6..9d9644c6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/CachedWorld.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/CachedWorld.java @@ -16,26 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.pathfinding; +package kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding; -import lombok.AllArgsConstructor; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.IProgressUpdate; import net.minecraft.world.*; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.storage.ISaveHandler; -import net.minecraft.world.storage.WorldInfo; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.util.List; public class CachedWorld extends World { private ChunkCache chunkCache; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/JPSPathfinder.java index 5d48ccb2..0a4e1b7d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/JPSPathfinder.java @@ -16,21 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.pathfinding; +package kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; import net.minecraft.util.*; -import net.minecraft.world.ChunkCache; import net.minecraft.world.World; -import java.lang.reflect.Proxy; import java.util.*; public class JPSPathfinder { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/NodeProcessorDungeonRoom.java index 91b86e22..cdce6cf4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/NodeProcessorDungeonRoom.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.pathfinding; +package kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import net.minecraft.block.Block; -import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -29,6 +29,7 @@ import net.minecraft.pathfinding.PathPoint; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.Vec3i; +import net.minecraft.world.World; import net.minecraft.world.pathfinder.NodeProcessor; import java.util.Set; @@ -36,6 +37,7 @@ import java.util.Set; public class NodeProcessorDungeonRoom extends NodeProcessor { private final DungeonRoom dungeonRoom; private final BlockPos sub; + public NodeProcessorDungeonRoom(DungeonRoom dungeonRoom) { this.dungeonRoom = dungeonRoom; sub = dungeonRoom.getMax().subtract(dungeonRoom.getMin()); @@ -43,41 +45,44 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { @Override public PathPoint getPathPointTo(Entity entityIn) { - return openPoint((int)entityIn.posX - dungeonRoom.getMin().getX(), (int)entityIn.posY - dungeonRoom.getMin().getY(), - (int)entityIn.posZ - dungeonRoom.getMin().getZ()); + return openPoint((int) entityIn.posX - dungeonRoom.getMin().getX(), (int) entityIn.posY - dungeonRoom.getMin().getY(), + (int) entityIn.posZ - dungeonRoom.getMin().getZ()); } @Override public PathPoint getPathPointToCoords(Entity entityIn, double x, double y, double z) { - return openPoint((int)x- dungeonRoom.getMin().getX(), (int)y - dungeonRoom.getMin().getY(), - (int)z - dungeonRoom.getMin().getZ()); + return openPoint((int) x - dungeonRoom.getMin().getX(), (int) y - dungeonRoom.getMin().getY(), + (int) z - dungeonRoom.getMin().getZ()); } - private static final EnumFacing[] values2 = new EnumFacing[6]; - static { - values2[0] = EnumFacing.DOWN; - values2[1] = EnumFacing.NORTH; - values2[2] = EnumFacing.SOUTH; - values2[3] = EnumFacing.EAST; - values2[4] = EnumFacing.WEST; - values2[5] = EnumFacing.UP; - } + private static final EnumFacing[] values2 = new EnumFacing[] { + EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.UP + }; + + @Override public int findPathOptions(PathPoint[] pathOptions, Entity entityIn, PathPoint currentPoint, PathPoint targetPoint, float maxDistance) { int i = 0; - for (EnumFacing ef:values2) { + for (EnumFacing ef : values2) { Vec3i dir = ef.getDirectionVec(); int newX = currentPoint.xCoord + dir.getX(); int newY = currentPoint.yCoord + dir.getY(); int newZ = currentPoint.zCoord + dir.getZ(); + if (newX < 0 || newZ < 0) continue; - if (newX > sub.getX()|| newZ > sub.getZ()) continue; - IBlockState curr = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)); - IBlockState up = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY + 1, newZ)); - if (isValidBlock(curr) - && isValidBlock(up )) { + if (newX > sub.getX() || newZ > sub.getZ()) continue; + + BlockPos add1 = dungeonRoom.getMin().add(newX, newY, newZ); + World playerWorld = entityIn.getEntityWorld(); + + IBlockState curr = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(add1); + + + IBlockState up = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(dungeonRoom.getMin().add(newX, newY + 1, newZ)); + + if (isValidBlock(curr) && isValidBlock(up)) { PathPoint pt = openPoint(newX, newY, newZ); if (pt.visited) continue; pathOptions[i++] = pt; @@ -86,12 +91,12 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { if (curr.getBlock() == Blocks.air) { if (up.getBlock() == Blocks.stone_slab - || up.getBlock() == Blocks.wooden_slab - || up.getBlock() == Blocks.stone_slab2) { - IBlockState up2 = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY -1, newZ)); + || up.getBlock() == Blocks.wooden_slab + || up.getBlock() == Blocks.stone_slab2) { + IBlockState up2 = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(dungeonRoom.getMin().add(newX, newY - 1, newZ)); if (up2.getBlock() == Blocks.stone_slab - || up2.getBlock() == Blocks.wooden_slab - || up2.getBlock() == Blocks.stone_slab2) { + || up2.getBlock() == Blocks.wooden_slab + || up2.getBlock() == Blocks.stone_slab2) { PathPoint pt = openPoint(newX, newY, newZ); if (pt.visited) continue; pathOptions[i++] = pt; @@ -100,23 +105,21 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { } } - if (dir.getY() == 0 && curr.getBlock() == Blocks.iron_bars && up.getBlock() == Blocks.air && - entityIn.getEntityWorld().getBlockState(new BlockPos(currentPoint.xCoord, currentPoint.yCoord, currentPoint.zCoord)).getBlock() != Blocks.iron_bars) { + if (dir.getY() == 0 + && curr.getBlock() == Blocks.iron_bars + && up.getBlock() == Blocks.air + && DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(new BlockPos(currentPoint.xCoord, currentPoint.yCoord, currentPoint.zCoord)).getBlock() != Blocks.iron_bars) { + boolean theFlag = false; if (dir.getZ() == 0) { - if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) - .add(0,0,1)).getBlock() == Blocks.air) { - theFlag = true; - } else if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) - .add(0,0,-1)).getBlock() == Blocks.air) { + if (DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState( + add1.add(0, 0, 1)).getBlock() == Blocks.air || + DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(add1.add(0, 0, -1)).getBlock() == Blocks.air) { theFlag = true; } } else if (dir.getX() == 0) { - if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) - .add(-1,0,0)).getBlock() == Blocks.air) { - theFlag = true; - } else if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) - .add(1,0,0)).getBlock() == Blocks.air) { + if (DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(add1.add(-1, 0, 0)).getBlock() == Blocks.air || + DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(add1.add(1, 0, 0)).getBlock() == Blocks.air) { theFlag = true; } } @@ -124,7 +127,6 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { PathPoint pt = openPoint(newX, newY, newZ); if (pt.visited) continue; pathOptions[i++] = pt; - continue; } } } @@ -132,11 +134,11 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { } public static final Set<Block> allowed = Sets.newHashSet(Blocks.air, Blocks.water, Blocks.lava, Blocks.flowing_water, Blocks.flowing_lava, Blocks.vine, Blocks.ladder - , Blocks.standing_sign, Blocks.wall_sign, Blocks.trapdoor, Blocks.iron_trapdoor, Blocks.wooden_button, Blocks.stone_button, Blocks.fire, + , Blocks.standing_sign, Blocks.wall_sign, Blocks.trapdoor, Blocks.iron_trapdoor, Blocks.wooden_button, Blocks.stone_button, Blocks.fire, Blocks.torch, Blocks.rail, Blocks.golden_rail, Blocks.activator_rail, Blocks.detector_rail, Blocks.carpet, Blocks.redstone_torch); public static final IBlockState preBuilt = Blocks.stone.getStateFromMeta(2); + public static boolean isValidBlock(IBlockState state) { - Block b = state.getBlock(); - return state.equals(preBuilt) || allowed.contains(b); + return state.equals(preBuilt) || allowed.contains(state.getBlock()); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/ThetaStar.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/ThetaStar.java index 032223f0..4a4cf786 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/ThetaStar.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/pathfinding/ThetaStar.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.pathfinding; +package kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.*; import net.minecraft.util.*; import net.minecraft.world.World; @@ -190,11 +190,9 @@ public class ThetaStar { return MathHelper.sqrt_float(x * x + y * y + z * z); } - @RequiredArgsConstructor @Data public static final class Node { @Data - @RequiredArgsConstructor public static final class Coordinate { private final int x, y, z; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/EditingContext.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/EditingContext.java index 1cafcbc7..8f5fec3f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/EditingContext.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/EditingContext.java @@ -16,18 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; -import lombok.Data; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonRoomEdit; import lombok.Getter; -import lombok.Setter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; -import java.util.LinkedList; import java.util.Stack; public class EditingContext { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/Parameter.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/Parameter.java index eb4d8987..850cbe11 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/Parameter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/Parameter.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit; -import lombok.AllArgsConstructor; import lombok.Data; @Data diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java index 4410d08e..4e4b5da4 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java @@ -16,25 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.gui; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.gui.MGui; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditOffsetPointSet; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditOffsetPointSet; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import java.awt.*; -import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java index 584d8472..0f2764de 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java @@ -16,28 +16,22 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.gui; - -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MGui; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.panes.DynamicEditor; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditRegistry; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui; + +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes.DynamicEditor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditRegistry; import lombok.Getter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import java.awt.*; -import java.io.IOException; public class GuiDungeonParameterEdit extends MGui { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java index 18c05ae5..181ff640 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java @@ -16,23 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.gui; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MGui; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MTabbedPane; -import kr.syeyoung.dungeonsguide.roomedit.panes.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTabbedPane; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes.*; import lombok.Getter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import java.awt.*; -import java.io.IOException; public class GuiDungeonRoomEdit extends MGui { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java index 56192361..af4657f5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java @@ -16,28 +16,22 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.gui; - -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MGui; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditRegistry; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui; + +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditRegistry; import lombok.Getter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import java.awt.*; import java.util.List; -import java.io.IOException; public class GuiDungeonValueEdit extends MGui { private DungeonRoom dungeonRoom; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditBreakableWall.java index 04ae7643..bcde40b9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditBreakableWall.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonBreakableWall; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.init.Blocks; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditDoor.java index 0fc7de4c..b2a30bfb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditDoor.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonDoor; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.init.Blocks; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditDummy.java index 7c211b52..64808dda 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDummy.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditDummy.java @@ -16,21 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonDummy; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonNPC; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; -import kr.syeyoung.dungeonsguide.gui.elements.MValue; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditFairySoul.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditFairySoul.java index 7ac9ac1a..3bd69eb9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditFairySoul.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditFairySoul.java @@ -16,18 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonFairySoul; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditJournal.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditJournal.java index f56b1630..1123050e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditJournal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditJournal.java @@ -16,21 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonFairySoul; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonJournal; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; -import kr.syeyoung.dungeonsguide.gui.elements.MValue; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditLever.java index aaeb607f..080be185 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditLever.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonLever; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditNPC.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditNPC.java index 4146b491..20608f8e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditNPC.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditNPC.java @@ -16,22 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonFairySoul; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonNPC; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; -import kr.syeyoung.dungeonsguide.gui.elements.MValue; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditOnewayDoor.java index ede6ee43..ffeba48d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditOnewayDoor.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonOnewayDoor; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.init.Blocks; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditOnewayLever.java index 2a15adad..a315b736 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditOnewayLever.java @@ -16,20 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonOnewayLever; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; -import kr.syeyoung.dungeonsguide.gui.elements.MValue; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditPressurePlate.java index 99d60baa..dac3d196 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditPressurePlate.java @@ -16,20 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonPressurePlate; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; -import kr.syeyoung.dungeonsguide.gui.elements.MValue; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; import java.util.Collections; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditSecret.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditSecret.java index 72cb410b..165105aa 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditSecret.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditSecret.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditTomb.java index 042a8258..2604b873 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/mechanicedit/ValueEditTomb.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.mechanicedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonTomb; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ActionDisplayPane.java index 68ccdf6c..2c886ac9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ActionDisplayPane.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionTree; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionTree; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ActionTreeDisplayPane.java index dd8331a7..bcc75a98 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ActionTreeDisplayPane.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; - -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionTree; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionTreeUtil; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; + +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionTree; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionTreeUtil; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -44,14 +43,14 @@ public class ActionTreeDisplayPane extends MPanel { private final DungeonRoom dungeonRoom; private final ActionTree tree; - private List<Action> linearified; + private List<AbstractAction> linearified; public ActionTreeDisplayPane(DungeonRoom dungeonRoom, ActionTree tree) { this.dungeonRoom = dungeonRoom; this.tree = tree; try { this.linearified = ActionTreeUtil.linearifyActionTree(tree); } catch (Exception e) { - linearified = new ArrayList<Action>(); + linearified = new ArrayList<AbstractAction>(); e.printStackTrace(); } scale = 1.0f; @@ -131,11 +130,11 @@ public class ActionTreeDisplayPane extends MPanel { return Math.max(xOff, dim.width); } - public void renderLinearified(List<Action> actions, int x, int y, FontRenderer fr) { + public void renderLinearified(List<AbstractAction> actions, int x, int y, FontRenderer fr) { Point lastPt = null; int y2 = y; - for (Action action : actions) { + for (AbstractAction action : actions) { Dimension dim = renderAction(action, x, y2, fr); if (lastPt != null) { GlStateManager.pushMatrix(); @@ -165,7 +164,7 @@ public class ActionTreeDisplayPane extends MPanel { } } - public Dimension renderAction(Action action, int x, int y, FontRenderer fr) { + public Dimension renderAction(AbstractAction action, int x, int y, FontRenderer fr) { String[] lines = action.toString().split("\n"); int maxWidth = 0; for (String line : lines) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/DynamicEditor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/DynamicEditor.java index 1c10e647..5be67660 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/DynamicEditor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/DynamicEditor.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; -import kr.syeyoung.dungeonsguide.gui.elements.MParameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MParameter; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/GeneralEditPane.java index 1133a8a9..a60797e8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/GeneralEditPane.java @@ -16,18 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.roomprocessor.ProcessorFactory; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.Main; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoomInfoRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.ProcessorFactory; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; @@ -150,7 +151,7 @@ public class GeneralEditPane extends MPanel { try { NBTTagCompound nbtTagCompound2 = createNBT(); - File f=new File(DungeonsGuide.getDungeonsGuide().getConfigDir(), "schematics/"+ + File f=new File(Main.getConfigDir(), "schematics/"+ dungeonRoom.getDungeonRoomInfo().getName()+"-"+dungeonRoom.getDungeonRoomInfo().getUuid().toString()+"-"+ UUID.randomUUID()+".schematic"); Method method = null; @@ -175,7 +176,7 @@ public class GeneralEditPane extends MPanel { { dataoutputstream.close(); } - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSaved to "+f.getName())); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §fSaved to "+f.getName())); } catch (Throwable e) { e.printStackTrace(); } @@ -236,7 +237,7 @@ public class GeneralEditPane extends MPanel { for (int z = 0; z < compound.getShort("Length"); z++) { int index = x + (y * compound.getShort("Length") + z) * compound.getShort("Width"); BlockPos pos = dungeonRoom.getRelativeBlockPosAt(x,y - 70,z); - IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(pos); + IBlockState blockState = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos); boolean acc = dungeonRoom.canAccessRelative(x,z); int id = Block.getIdFromBlock(blockState.getBlock()); blocks[index] = acc ? (byte) id : 0; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ProcessorParameterEditPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ProcessorParameterEditPane.java index d719185d..5b907fb7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ProcessorParameterEditPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/ProcessorParameterEditPane.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MParameter; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MParameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditRegistry; import java.awt.*; import java.util.ArrayList; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoomDataDisplayPane.java index bd3da672..f2ae85c3 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoomDataDisplayPane.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoomMatchDisplayPane.java index 3379098b..b7023c4b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoomMatchDisplayPane.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; - -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltipText; -import kr.syeyoung.dungeonsguide.utils.ArrayUtils; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; + +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoomInfoRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltip; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltipText; +import kr.syeyoung.dungeonsguide.mod.utils.ArrayUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoommatchingPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoommatchingPane.java index 00d7ae04..964c450b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoommatchingPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/RoommatchingPane.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; import java.awt.*; import java.util.UUID; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/SecretEditPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/SecretEditPane.java index 70b3e381..5c52e770 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/SecretEditPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/panes/SecretEditPane.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.panes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MParameter; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditCreator; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditRegistry; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MParameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditCreator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditRegistry; import java.awt.*; import java.util.ArrayList; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEdit.java index b5c135c4..d52094de 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEdit.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; public interface ValueEdit<T extends Object> { void setParameter(Parameter parameter); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditAColor.java index e3e22bf7..c42fa423 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditAColor.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MColor; -import kr.syeyoung.dungeonsguide.gui.elements.MFloatSelectionButton; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MColor; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MFloatSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditBoolean.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditBoolean.java index dfd854bf..639afc20 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditBoolean.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditBoolean.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MStringSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MStringSelectionButton; import java.awt.*; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditColor.java index 3e59154e..5ef977a1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditColor.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditCreator.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditCreator.java index dda484d9..5d37040b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditCreator.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditCreator.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; public interface ValueEditCreator<T extends ValueEdit> { T createValueEdit(Parameter parameter); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditFloat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java index 4092cf28..e44adab1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditFloat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MFloatSelectionButton; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MFloatSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditInteger.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditInteger.java index 8a5f36c9..4b93a30d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditInteger.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditInteger.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MIntegerSelectionButton; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MIntegerSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditNull.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditNull.java index 4c9e32a7..0868470e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditNull.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditNull.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; public class ValueEditNull implements ValueEditCreator { @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditOffsetPoint.java index 1cd4deba..813ac68a 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditOffsetPoint.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPointSet.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditOffsetPointSet.java index 0cdaab0d..cd6351bd 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPointSet.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditOffsetPointSet.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MValue; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonAddSet; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditRegistry.java index 1df64a6c..af368f2c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditRegistry.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; -import kr.syeyoung.dungeonsguide.roomedit.mechanicedit.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.mechanicedit.*; import java.awt.*; import java.util.ArrayList; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditString.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditString.java index 157e7b42..0d2b3697 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditString.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditString.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomedit.valueedit; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.gui.elements.MLabel; -import kr.syeyoung.dungeonsguide.gui.elements.MLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MTextField; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTextField; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java index 2419f50a..5834d67e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java @@ -16,24 +16,24 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.roomfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder; import com.google.common.collect.Sets; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.MapProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.MapProcessor; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.EDungeonDoorType; -import kr.syeyoung.dungeonsguide.dungeon.events.DungeonStateChangeEvent; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.EDungeonDoorType; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonStateChangeEvent; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonRoomDoor; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.secret.FeaturePathfindStrategy; -import kr.syeyoung.dungeonsguide.pathfinding.*; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomprocessor.ProcessorFactory; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.ProcessorFactory; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessorGenerator; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.impl.secret.FeaturePathfindStrategy; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; @@ -50,8 +50,8 @@ import net.minecraft.world.World; import javax.vecmath.Vector2d; import java.awt.*; -import java.util.*; import java.util.List; +import java.util.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -69,7 +69,7 @@ public class DungeonRoom { private final DungeonContext context; - private final List<DungeonDoor> doors = new ArrayList<DungeonDoor>(); + private final List<DungeonDoor> doors = new ArrayList<>(); private DungeonRoomInfo dungeonRoomInfo; @@ -83,10 +83,10 @@ public class DungeonRoom { private Map<String, DungeonMechanic> cached = null; @Getter - private World cachedWorld; + private final World cachedWorld; public Map<String, DungeonMechanic> getMechanics() { if (cached == null || EditingContext.getEditingContext() != null) { - cached = new HashMap<String, DungeonMechanic>(dungeonRoomInfo.getMechanics()); + cached = new HashMap<>(dungeonRoomInfo.getMechanics()); int index = 0; for (DungeonDoor door : doors) { if (door.getType().isExist()) cached.put((door.getType().getName())+"-"+(++index), new DungeonRoomDoor(this, door)); @@ -100,47 +100,43 @@ public class DungeonRoom { this.currentState = currentState; } - private Map<BlockPos, AStarFineGrid> activeBetterAStar = new HashMap<>(); - private Map<BlockPos, AStarCornerCut> activeBetterAStarCornerCut = new HashMap<>(); - private Map<BlockPos, ThetaStar> activeThetaStar = new HashMap<>(); + private final Map<BlockPos, AStarFineGrid> activeBetterAStar = new HashMap<>(); + private final Map<BlockPos, AStarCornerCut> activeBetterAStarCornerCut = new HashMap<>(); + private final Map<BlockPos, ThetaStar> activeThetaStar = new HashMap<>(); public ScheduledFuture<List<Vec3>> createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, BlockPos targetPos, float dist, int timeout) { FeaturePathfindStrategy.PathfindStrategy pathfindStrategy = FeatureRegistry.SECRET_PATHFIND_STRATEGY.getPathfindStrat(); if (pathfindStrategy == FeaturePathfindStrategy.PathfindStrategy.JPS_LEGACY) { - ScheduledFuture<List<Vec3>> sf = asyncPathFinder.schedule(() -> { + return asyncPathFinder.schedule(() -> { BlockPos min = new BlockPos(getMin().getX(), 0, getMin().getZ()); BlockPos max= new BlockPos(getMax().getX(), 255, getMax().getZ()); JPSPathfinder pathFinder = new JPSPathfinder(this); pathFinder.pathfind(entityIn.getPositionVector(), new Vec3(targetPos).addVector(0.5, 0.5, 0.5), 1.5f,timeout); return pathFinder.getRoute(); }, 0, TimeUnit.MILLISECONDS); - return sf; } else if (pathfindStrategy == FeaturePathfindStrategy.PathfindStrategy.A_STAR_FINE_GRID) { - ScheduledFuture<List<Vec3>> sf = asyncPathFinder.schedule(() -> { + return asyncPathFinder.schedule(() -> { AStarFineGrid pathFinder = activeBetterAStar.computeIfAbsent(targetPos, (pos) -> new AStarFineGrid(this, new Vec3(pos.getX(), pos.getY(), pos.getZ()).addVector(0.5, 0.5, 0.5))); pathFinder.pathfind(entityIn.getPositionVector(),timeout); return pathFinder.getRoute(); }, 0, TimeUnit.MILLISECONDS); - return sf; }else if (pathfindStrategy == FeaturePathfindStrategy.PathfindStrategy.A_STAR_DIAGONAL) { - ScheduledFuture<List<Vec3>> sf = asyncPathFinder.schedule(() -> { + return asyncPathFinder.schedule(() -> { AStarCornerCut pathFinder = activeBetterAStarCornerCut.computeIfAbsent(targetPos, (pos) -> new AStarCornerCut(this, new Vec3(pos.getX(), pos.getY(), pos.getZ()).addVector(0.5, 0.5, 0.5))); pathFinder.pathfind(entityIn.getPositionVector(),timeout); return pathFinder.getRoute(); }, 0, TimeUnit.MILLISECONDS); - return sf; } else if (pathfindStrategy == FeaturePathfindStrategy.PathfindStrategy.THETA_STAR) { - ScheduledFuture<List<Vec3>> sf = asyncPathFinder.schedule(() -> { + return asyncPathFinder.schedule(() -> { ThetaStar pathFinder = activeThetaStar.computeIfAbsent(targetPos, (pos) -> new ThetaStar(this, new Vec3(pos.getX(), pos.getY(), pos.getZ()).addVector(0.5, 0.5, 0.5))); pathFinder.pathfind(entityIn.getPositionVector(),timeout); return pathFinder.getRoute(); }, 0, TimeUnit.MILLISECONDS); - return sf; } else { - ScheduledFuture<List<Vec3>> sf = asyncPathFinder.schedule(() -> { + return asyncPathFinder.schedule(() -> { PathFinder pathFinder = new PathFinder(nodeProcessorDungeonRoom); PathEntity latest = pathFinder.createEntityPathTo(blockaccess, entityIn, targetPos, dist); if (latest != null) { @@ -153,7 +149,6 @@ public class DungeonRoom { } return new ArrayList<>(); }, 0, TimeUnit.MILLISECONDS); - return sf; } } @@ -162,7 +157,7 @@ public class DungeonRoom { private final NodeProcessorDungeonRoom nodeProcessorDungeonRoom; @Getter - private final Map<String, Object> roomContext = new HashMap<String, Object>(); + private final Map<String, Object> roomContext = new HashMap<>(); @AllArgsConstructor @Getter @@ -302,9 +297,14 @@ public class DungeonRoom { - long arr[]; + long[] arr; // These values are doubled - private final int minx, miny, minz, maxx, maxy, maxz; + private final int minx; + private final int miny; + private final int minz; + private final int maxx; + private final int maxy; + private final int maxz; private final int lenx, leny, lenz; private static final float playerWidth = 0.3f; public boolean isBlocked(int x,int y, int z) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoomInfoRegistry.java index e336ae21..72000d38 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoomInfoRegistry.java @@ -16,20 +16,21 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.roomfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder; import com.google.common.io.Files; +import com.google.gson.Gson; import kr.syeyoung.dungeonsguide.Main; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import lombok.Getter; import net.minecraft.client.Minecraft; import org.apache.commons.io.IOUtils; +import org.jetbrains.annotations.NotNull; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import java.io.*; -import java.net.URL; import java.nio.charset.Charset; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; @@ -42,8 +43,23 @@ public class DungeonRoomInfoRegistry { private static final Map<Short, List<DungeonRoomInfo>> shapeMap = new HashMap<Short, List<DungeonRoomInfo>>(); private static final Map<UUID, DungeonRoomInfo> uuidMap = new HashMap<UUID, DungeonRoomInfo>(); - public static void register(DungeonRoomInfo dungeonRoomInfo) { - if (dungeonRoomInfo == null) throw new NullPointerException("what the fak parameter is noll?"); + static Gson gson = new Gson(); + + public static void register(@NotNull DungeonRoomInfo dungeonRoomInfo) { + +// System.out.println("Loading room: " + dungeonRoomInfo.getUuid()); +// +// File file = new File(Main.getConfigDir() + "/" + "rooms" + "/" + dungeonRoomInfo.getUuid() + ".json"); +// if(!file.exists()){ +// try { +// FileUtils.writeStringToFile(file, gson.toJson(dungeonRoomInfo)); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } +// } + + + if (uuidMap.containsKey(dungeonRoomInfo.getUuid())) { DungeonRoomInfo dri1 = uuidMap.get(dungeonRoomInfo.getUuid()); registered.remove(dri1); @@ -54,7 +70,9 @@ public class DungeonRoomInfoRegistry { registered.add(dungeonRoomInfo); uuidMap.put(dungeonRoomInfo.getUuid(), dungeonRoomInfo); List<DungeonRoomInfo> roomInfos = shapeMap.get(dungeonRoomInfo.getShape()); - if (roomInfos == null) roomInfos = new ArrayList<DungeonRoomInfo>(); + if (roomInfos == null) { + roomInfos = new ArrayList<>(); + } roomInfos.add(dungeonRoomInfo); shapeMap.put(dungeonRoomInfo.getShape(), roomInfos); } @@ -81,8 +99,8 @@ public class DungeonRoomInfoRegistry { public static void saveAll(File dir) { dir.mkdirs(); boolean isDev = Minecraft.getMinecraft().getSession().getPlayerID().replace("-","").equals("e686fe0aab804a71ac7011dc8c2b534c"); - String nameidstring = "name,uuid,processsor,secrets"; - String ids = ""; + StringBuilder nameidstring = new StringBuilder("name,uuid,processsor,secrets"); + StringBuilder ids = new StringBuilder(); for (DungeonRoomInfo dungeonRoomInfo : registered) { try { if (!dungeonRoomInfo.isUserMade() && !isDev) continue; @@ -92,14 +110,14 @@ public class DungeonRoomInfoRegistry { oos.flush(); oos.close(); - nameidstring += "\n"+dungeonRoomInfo.getName()+","+dungeonRoomInfo.getUuid() +","+dungeonRoomInfo.getProcessorId()+","+dungeonRoomInfo.getTotalSecrets(); - ids += "roomdata/"+dungeonRoomInfo.getUuid() +".roomdata\n"; + nameidstring.append("\n").append(dungeonRoomInfo.getName()).append(",").append(dungeonRoomInfo.getUuid()).append(",").append(dungeonRoomInfo.getProcessorId()).append(",").append(dungeonRoomInfo.getTotalSecrets()); + ids.append("roomdata/").append(dungeonRoomInfo.getUuid()).append(".roomdata\n"); } catch (Exception e) {e.printStackTrace();} } try { - Files.write(nameidstring, new File(dir, "roomidmapping.csv"), Charset.defaultCharset()); - Files.write(ids, new File(dir, "datas.txt"), Charset.defaultCharset()); + Files.write(nameidstring.toString(), new File(dir, "roomidmapping.csv"), Charset.defaultCharset()); + Files.write(ids.toString(), new File(dir, "datas.txt"), Charset.defaultCharset()); } catch (IOException e) { e.printStackTrace(); } @@ -125,7 +143,9 @@ public class DungeonRoomInfoRegistry { e.printStackTrace(); } } - } catch (Exception e) {e.printStackTrace();} + } catch (Exception e) { + e.printStackTrace(); + } for (File f : dir.listFiles()) { if (!f.getName().endsWith(".roomdata")) continue; try { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/RoomMatcher.java index 9052ba3e..994a19d8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/RoomMatcher.java @@ -16,33 +16,30 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.dungeon.roomfinder; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; -import kr.syeyoung.dungeonsguide.utils.ArrayUtils; -import kr.syeyoung.dungeonsguide.utils.ShortUtils; +import kr.syeyoung.dungeonsguide.mod.utils.ArrayUtils; +import kr.syeyoung.dungeonsguide.mod.utils.ShortUtils; import lombok.Getter; import net.minecraft.block.Block; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; +import net.minecraft.util.ChatComponentText; import java.util.List; public class RoomMatcher { private final DungeonRoom dungeonRoom; - @Getter private DungeonRoomInfo match; @Getter private int rotation; // how much the "found room" has to rotate clockwise to match the given dungeon room info. ! private boolean triedMatch = false; - private final World w; public RoomMatcher(DungeonRoom dungeonRoom) { this.dungeonRoom = dungeonRoom; - w = dungeonRoom.getContext().getWorld(); } public DungeonRoomInfo match() { @@ -53,8 +50,7 @@ public class RoomMatcher { for (int z = 0; z < zz; z ++) { for (int x = 0; x < xx; x++) { if (x % 8 == 0 && z % 8 == 0 && dungeonRoom.getContext().getWorld().getChunkFromBlockCoords(dungeonRoom.getRelativeBlockPosAt(x, 0, z)).isEmpty()) { - throw new IllegalStateException("chunk is not loaded"); - + ChatTransmitter.sendDebugChat(new ChatComponentText("Chunk Not loaded in Room Matcher")); } } } @@ -121,16 +117,10 @@ public class RoomMatcher { int maxZ = dungeonRoom.getMax().getZ(); int minX = dungeonRoom.getMin().getX(); int minZ = dungeonRoom.getMin().getZ(); - int widthX = maxX - minX + 2; - int heightZ = maxZ - minZ + 2; int[][] data = new int[dungeonRoom.getMax().getZ() - dungeonRoom.getMin().getZ() +2][dungeonRoom.getMax().getX() - dungeonRoom.getMin().getX() + 2]; for (int z = 0; z < data.length; z++) { for (int x = 0; x < data[0].length; x++) { -// if (!(offset < x && widthX - offset > x && offset < z && heightZ - offset > z)) { -// data[z][x] = -1; -// continue; -// } if (!(dungeonRoom.canAccessRelative(x + offset, z + offset) && dungeonRoom.canAccessRelative(x - offset -1 , z - offset-1) && dungeonRoom.canAccessRelative(x + offset , z - offset-1) diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java index 452c0003..22cdb20c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java @@ -16,31 +16,31 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.DungeonActionManager; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionComplete; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMoveNearestAir; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonActionContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionComplete; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.ActionMoveNearestAir; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonRoomDoor; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.pathfinding.NodeProcessorDungeonRoom; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; -import kr.syeyoung.dungeonsguide.utils.VectorUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.events.impl.BlockUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.pathfinding.NodeProcessorDungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonAddSet; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonRoomEdit; +import kr.syeyoung.dungeonsguide.mod.utils.VectorUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.block.state.IBlockState; @@ -78,9 +78,9 @@ public class GeneralRoomProcessor implements RoomProcessor { @Override public void tick() { - if (!ticked && FeatureRegistry.SECRET_AUTO_START.isEnabled()) + if (!ticked && FeatureRegistry.SECRET_AUTO_START.isEnabled()) { searchForNextTarget(); - if (!ticked && FeatureRegistry.SECRET_PATHFIND_ALL.isEnabled()) { + }else if (!ticked && FeatureRegistry.SECRET_PATHFIND_ALL.isEnabled()) { for (Map.Entry<String, DungeonMechanic> value : getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonSecret && ((DungeonSecret) value.getValue()).getSecretStatus(dungeonRoom) != DungeonSecret.SecretStatus.FOUND) { DungeonSecret dungeonSecret = (DungeonSecret) value.getValue(); @@ -94,8 +94,7 @@ public class GeneralRoomProcessor implements RoomProcessor { pathfind(value.getKey(), "found", FeatureRegistry.SECRET_LINE_PROPERTIES_PATHFINDALL_ITEM_DROP.getRouteProperties()); } } - } - if (!ticked && FeatureRegistry.SECRET_BLOOD_RUSH.isEnabled()) { + } else if (!ticked && FeatureRegistry.SECRET_BLOOD_RUSH.isEnabled()) { for (Map.Entry<String, DungeonMechanic> value : getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonRoomDoor) { DungeonRoomDoor dungeonDoor = (DungeonRoomDoor) value.getValue(); @@ -179,11 +178,11 @@ public class GeneralRoomProcessor implements RoomProcessor { if (en == null) return; ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - if (DungeonActionManager.getSpawnLocation().containsKey(en.getEntityId())) { + if (DungeonActionContext.getSpawnLocation().containsKey(en.getEntityId())) { GlStateManager.enableBlend(); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - fr.drawString("Spawned at " + DungeonActionManager.getSpawnLocation().get(en.getEntityId()), sr.getScaledWidth() / 2, sr.getScaledHeight() / 2, 0xFFFFFFFF); + fr.drawString("Spawned at " + DungeonActionContext.getSpawnLocation().get(en.getEntityId()), sr.getScaledWidth() / 2, sr.getScaledHeight() / 2, 0xFFFFFFFF); } } } @@ -248,11 +247,12 @@ public class GeneralRoomProcessor implements RoomProcessor { public void actionbarReceived(IChatComponent chat) { if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; if (dungeonRoom.getTotalSecrets() == -1) { - DungeonsGuide.sendDebugChat(new ChatComponentText(chat.getFormattedText().replace('§', '&') + " - received")); + ChatTransmitter.sendDebugChat(new ChatComponentText(chat.getFormattedText().replace('§', '&') + " - received")); } if (!chat.getFormattedText().contains("/")) return; BlockPos pos = Minecraft.getMinecraft().thePlayer.getPosition(); - DungeonContext context = DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext(); + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); Point pt1 = context.getMapProcessor().worldPointToRoomPoint(pos.add(2, 0, 2)); Point pt2 = context.getMapProcessor().worldPointToRoomPoint(pos.add(-2, 0, -2)); if (!pt1.equals(pt2)) { @@ -302,12 +302,12 @@ public class GeneralRoomProcessor implements RoomProcessor { return path.get(id); } - public String pathfind(String mechanic, String state, ActionRoute.ActionRouteProperties actionRouteProperties) { - String str; - pathfind(str = UUID.randomUUID().toString(), mechanic, state, actionRouteProperties); + public String pathfind(String mechanic, String state, ActionRouteProperties actionRouteProperties) { + String str = UUID.randomUUID().toString(); + pathfind(str, mechanic, state, actionRouteProperties); return str; } - public void pathfind(String id, String mechanic, String state, ActionRoute.ActionRouteProperties actionRouteProperties) { + public void pathfind(String id, String mechanic, String state, ActionRouteProperties actionRouteProperties) { path.put(id, new ActionRoute(getDungeonRoom(), mechanic, state, actionRouteProperties)); } public void cancelAll() { @@ -411,7 +411,7 @@ public class GeneralRoomProcessor implements RoomProcessor { DungeonSecret secret = new DungeonSecret(); secret.setSecretType(DungeonSecret.SecretType.BAT); secret.setSecretPoint(new OffsetPoint(dungeonRoom, - DungeonActionManager.getSpawnLocation().get(deathEvent.entity.getEntityId()) + DungeonActionContext.getSpawnLocation().get(deathEvent.entity.getEntityId()) )); ((GuiDungeonRoomEdit) screen).getSep().createNewMechanic("BAT-"+ UUID.randomUUID(), secret); @@ -422,7 +422,7 @@ public class GeneralRoomProcessor implements RoomProcessor { DungeonSecret secret = new DungeonSecret(); secret.setSecretType(DungeonSecret.SecretType.BAT); secret.setSecretPoint(new OffsetPoint(dungeonRoom, - DungeonActionManager.getSpawnLocation().get(deathEvent.entity.getEntityId()) + DungeonActionContext.getSpawnLocation().get(deathEvent.entity.getEntityId()) )); ((GuiDungeonRoomEdit) EditingContext.getEditingContext().getCurrent()).getSep().createNewMechanic("BAT-"+ UUID.randomUUID(), secret); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/ProcessorFactory.java index f4dee8f4..1c61a45d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/ProcessorFactory.java @@ -16,19 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.boxpuzzle.RoomProcessorBoxSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.icefill.RoomProcessorIcePath2; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.RoomProcessorWaterPuzzle; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.boxpuzzle.RoomProcessorBoxSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.icefill.RoomProcessorIcePath2; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.RoomProcessorWaterPuzzle; import java.util.HashMap; import java.util.Map; import java.util.Set; public class ProcessorFactory { - private static final Map<String, RoomProcessorGenerator> map = new HashMap<String, RoomProcessorGenerator>(); + private static final Map<String, RoomProcessorGenerator> map = new HashMap<>(); public static RoomProcessorGenerator getRoomProcessorGenerator(String processorId) { return map.get(processorId); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessor.java index d340366e..96b9fb72 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessor.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.BlockUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorBlazeSolver.java index dcdb32b8..f36fd71b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorBlazeSolver.java @@ -16,37 +16,22 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; - -import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.solvers.FeatureSolverBlaze; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.monster.EntityBlaze; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemBow; import net.minecraft.util.*; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; import org.lwjgl.opengl.GL11; -import java.awt.*; import java.util.ArrayList; import java.util.Comparator; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorButtonSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorButtonSolver.java index 4faf456c..709922a0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorButtonSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorButtonSolver.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.BlockPos; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorCreeperSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorCreeperSolver.java index ed9cadf0..b2c236c8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorCreeperSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorCreeperSolver.java @@ -16,28 +16,23 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; -import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.init.Blocks; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; import java.awt.*; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; public class RoomProcessorCreeperSolver extends GeneralRoomProcessor { @@ -67,7 +62,7 @@ public class RoomProcessorCreeperSolver extends GeneralRoomProcessor { ); for (BlockPos pos : BlockPos.getAllInBox(low, high)) { - Block b = w.getBlockState(pos).getBlock(); + Block b = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos).getBlock(); if (b == Blocks.prismarine || b == Blocks.sea_lantern) { for (EnumFacing face:EnumFacing.VALUES) { if (w.getBlockState(pos.offset(face)).getBlock() == Blocks.air) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorGenerator.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorGenerator.java index 97ad2d22..969424d9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorGenerator.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorGenerator.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; public interface RoomProcessorGenerator<T extends RoomProcessor> { T createNew(DungeonRoom dungeonRoom); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java index 03654a88..df902858 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java @@ -16,16 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.config.types.AColor; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.AllArgsConstructor; import lombok.Getter; import net.minecraft.entity.Entity; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorRedRoom.java index 2ac55ea8..d171c928 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorRedRoom.java @@ -16,22 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.boss.FeatureWarningOnPortal; -import kr.syeyoung.dungeonsguide.features.text.StyledTextRenderer; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.impl.boss.FeatureWarningOnPortal; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledTextRenderer; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorRiddle.java index 7994e86b..f7a0b65f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorRiddle.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.init.Blocks; import net.minecraft.util.AxisAlignedBB; @@ -35,7 +34,6 @@ import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; @@ -72,7 +70,7 @@ public class RoomProcessorRiddle extends GeneralRoomProcessor { } } if (foundMatch) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eRiddle §7:: "+ch2.split(":")[0].trim()+" §fhas the reward!")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eRiddle §7:: "+ch2.split(":")[0].trim()+" §fhas the reward!")); final String name = TextUtils.stripColor(ch2.split(":")[0]).replace("[NPC] ","").trim(); final BlockPos low = getDungeonRoom().getMin(); final BlockPos high = getDungeonRoom().getMax(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java index a16fc11e..30f1d385 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java @@ -16,12 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -30,14 +29,13 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; public class RoomProcessorTeleportMazeSolver extends GeneralRoomProcessor { + @Nullable private BlockPos lastPlayerLocation; public RoomProcessorTeleportMazeSolver(DungeonRoom dungeonRoom) { @@ -88,7 +86,9 @@ public class RoomProcessorTeleportMazeSolver extends GeneralRoomProcessor { if (b == Blocks.stone_slab || b == Blocks.stone_slab2) { boolean teleport = false; - if (lastPlayerLocation.distanceSq(pos2) < 3) return; + if (lastPlayerLocation != null && lastPlayerLocation.distanceSq(pos2) < 3) { + return; + } for (BlockPos allInBox : BlockPos.getAllInBox(lastPlayerLocation, pos2)) { if (w.getChunkFromBlockCoords(allInBox).getBlock(allInBox) == Blocks.iron_bars) { teleport = true; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTicTacToeSolver.java index 42c178cd..9ee8c215 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTicTacToeSolver.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import kr.syeyoung.dungeonsguide.config.Config; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.init.Blocks; @@ -34,7 +33,6 @@ import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.storage.MapData; -import java.awt.*; import java.util.List; public class RoomProcessorTicTacToeSolver extends GeneralRoomProcessor { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTrivia.java index 8e022679..b7956122 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTrivia.java @@ -16,17 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor; -import kr.syeyoung.dungeonsguide.config.Config; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.SkyblockUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; -import net.minecraft.client.Minecraft; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.SkyblockUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; @@ -34,9 +33,8 @@ import net.minecraft.util.IChatComponent; import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONObject; -import java.awt.*; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -107,11 +105,11 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { else theRealAnswer = semi_answers; } if (theRealAnswer == null) - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eTrivia §7:: §cCouldn't determine the answer! (no question found)")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eTrivia §7:: §cCouldn't determine the answer! (no question found)")); else if (theRealAnswer.length() >1) - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eTrivia §7:: §cCouldn't determine the answer! ("+theRealAnswer+")")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eTrivia §7:: §cCouldn't determine the answer! ("+theRealAnswer+")")); else - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eTrivia §7:: "+theRealAnswer+"§f is the correct answer!")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eTrivia §7:: "+theRealAnswer+"§f is the correct answer!")); correctAnswer = theRealAnswer; }); } @@ -119,7 +117,7 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { private String takeCareOfPlaceHolders(String input) { String str = input; if (str.contains("$year")) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §fuses §eInventiveTalent§7(https://github.com/InventivetalentDev)§e's Skyblock Api §fto fetch current skyblock year!")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §fuses §eInventiveTalent§7(https://github.com/InventivetalentDev)§e's Skyblock Api §fto fetch current skyblock year!")); try { str = str.replace("$year", SkyblockUtils.getSkyblockYear()+""); } catch (IOException e) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java index 0fa14951..d3d7ae3b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java @@ -16,29 +16,29 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.DummyDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.arrow.ArrowProcessorMatcher; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.bugged.ImpossibleMatcher; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color.ColorProcessorMatcher; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper.CreeperProcessorMatcher; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.goldenpath.GoldenPathProcessorMatcher; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.maze.MazeProcessorMatcher; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.number.NumberProcessorMatcher; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessorGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.DummyDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.arrow.ArrowProcessorMatcher; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.bugged.ImpossibleMatcher; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.color.ColorProcessorMatcher; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.creeper.CreeperProcessorMatcher; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.goldenpath.GoldenPathProcessorMatcher; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.maze.MazeProcessorMatcher; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.number.NumberProcessorMatcher; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; @@ -176,7 +176,7 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { } } catch (IOException e2) { e2.printStackTrace(); - DungeonsGuide.sendDebugChat(new ChatComponentText("Failed to send Bomb Defuse Chat")); + ChatTransmitter.sendDebugChat(new ChatComponentText("Failed to send Bomb Defuse Chat")); } } @@ -206,7 +206,7 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { } } catch (Throwable t) { t.printStackTrace(); - DungeonsGuide.sendDebugChat(new ChatComponentText("Failed to analyze Bomb Defuse Chat")); + ChatTransmitter.sendDebugChat(new ChatComponentText("Failed to analyze Bomb Defuse Chat")); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/BDChamber.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/BDChamber.java index 8063e53f..2dc754b1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/BDChamber.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/BDChamber.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers; import com.google.common.base.Predicate; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.Nullable; @@ -55,7 +55,7 @@ public class BDChamber { public IBlockState getBlock(int x, int y, int z) { BlockPos pos = getBlockPos(x,y,z); - return room.getContext().getWorld().getBlockState(pos); + return DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos); } public boolean isWithinAbsolute(int x, int y, int z) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/BombDefuseChamberGenerator.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/BombDefuseChamberGenerator.java index 26dcf724..8c43ca36 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/BombDefuseChamberGenerator.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/BombDefuseChamberGenerator.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; public interface BombDefuseChamberGenerator { boolean match(BDChamber left, BDChamber right); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/ChamberProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/ChamberProcessor.java index 1c6e39da..c4d63f42 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/ChamberProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/ChamberProcessor.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessor; import net.minecraft.nbt.NBTTagCompound; public interface ChamberProcessor extends RoomProcessor { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/DummyDefuseChamberProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/DummyDefuseChamberProcessor.java index 7e6010d5..d7056dbf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/DummyDefuseChamberProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/DummyDefuseChamberProcessor.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; public class DummyDefuseChamberProcessor extends GeneralDefuseChamberProcessor { public DummyDefuseChamberProcessor(RoomProcessorBombDefuseSolver solver, BDChamber chamber) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java index 3f8172d2..0040bc4f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers; - -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers; + +import kr.syeyoung.dungeonsguide.mod.events.impl.BlockUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -36,7 +35,6 @@ import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java index 48429e1d..94b4f78d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.arrow; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.arrow; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java index 1dcb0e1a..82a972b2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.arrow; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.arrow; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class ArrowProcessorMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java index 88b94794..9c293bc7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.arrow; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.arrow; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/bugged/ImpossibleMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/bugged/ImpossibleMatcher.java index 4ae397e8..42a00119 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/bugged/ImpossibleMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/bugged/ImpossibleMatcher.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.bugged; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.bugged; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class ImpossibleMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java index f7972d95..e0291d00 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.color; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.item.ItemStack; @@ -33,8 +32,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import org.lwjgl.input.Keyboard; -import org.omg.PortableInterceptor.INACTIVE; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java index fdd78a9f..5505fe9c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.color; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class ColorProcessorMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java index d5589cfc..5c77abe1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.color; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.item.EntityArmorStand; @@ -33,7 +32,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.BlockPos; -import org.lwjgl.input.Keyboard; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java index 32b48478..f651a780 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java @@ -16,24 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.creeper; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import net.minecraft.entity.item.EntityArmorStand; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.util.BlockPos; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import java.awt.*; -import java.util.BitSet; public class CreeperLeftProcessor extends GeneralDefuseChamberProcessor { public CreeperLeftProcessor(RoomProcessorBombDefuseSolver solver, BDChamber chamber) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java index 4b72d364..f2ad23b6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.creeper; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class CreeperProcessorMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java index 82479c6b..258c0e8f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java @@ -16,17 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.creeper; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import net.minecraft.init.Blocks; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java index f0fd566f..6a531aed 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java @@ -16,22 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.goldenpath; - -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.goldenpath; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; -import javax.vecmath.Vector2f; import java.awt.*; import java.util.*; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathProcessorMatcher.java index ce2a6077..5f5ac89b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathProcessorMatcher.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.goldenpath; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.goldenpath; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper.CreeperLeftProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper.CreeperRightProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class GoldenPathProcessorMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java index 8028609f..d432da80 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java @@ -16,23 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.goldenpath; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.goldenpath; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.IChatComponent; import net.minecraft.world.World; -import org.lwjgl.opengl.GL11; import java.awt.*; -import java.util.List; import java.util.*; public class GoldenPathRightProcessor extends GeneralDefuseChamberProcessor { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java index 77c8134b..d2b9927c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java @@ -16,33 +16,25 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.maze; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.maze; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.settings.GameSettings; -import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; -import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; -import java.awt.*; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - public class MazeLeftProcessor extends GeneralDefuseChamberProcessor { public MazeLeftProcessor(RoomProcessorBombDefuseSolver solver, BDChamber chamber) { super(solver, chamber); @@ -60,8 +52,7 @@ public class MazeLeftProcessor extends GeneralDefuseChamberProcessor { MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver; if (pos.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) return; - BlockPos block = pos.getBlockPos(); - Block b = getChamber().getRoom().getContext().getWorld().getBlockState(block).getBlock(); + Block b = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(pos.getBlockPos()).getBlock(); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java index 9a4bddbd..1429d302 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.maze; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.maze; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.goldenpath.GoldenPathLeftProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.goldenpath.GoldenPathRightProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class MazeProcessorMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java index 0bff75fd..df9f8f93 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java @@ -16,21 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.maze; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.maze; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; -import net.minecraft.util.MovingObjectPosition; -import org.lwjgl.input.Keyboard; import java.awt.*; import java.util.HashMap; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java index 7cdd4f00..11c7fefd 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java @@ -16,26 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.number; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.number; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.ScaledResolution; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; import net.minecraft.util.BlockPos; -import org.lwjgl.input.Keyboard; public class NumberLeftProcessor extends GeneralDefuseChamberProcessor { public NumberLeftProcessor(RoomProcessorBombDefuseSolver solver, BDChamber chamber) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java index 81588328..488583ff 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.number; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.number; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.ChamberProcessor; import net.minecraft.init.Blocks; public class NumberProcessorMatcher implements BombDefuseChamberGenerator { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java index 949f7621..66ba993a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java @@ -16,21 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.number; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.number; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; -import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; import net.minecraft.util.BlockPos; public class NumberRightProcessor extends GeneralDefuseChamberProcessor { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessor.java index a889f3b5..12ef6bdf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessor.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessor; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorBonzo.java index 249cc3fe..3380a447 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorBonzo.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import net.minecraft.client.entity.EntityOtherPlayerMP; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraftforge.event.entity.living.LivingEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorLivid.java index ace0fd67..f75226b6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorLivid.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; import net.minecraft.client.entity.EntityOtherPlayerMP; import net.minecraft.entity.item.EntityArmorStand; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorNecron.java index 92718c15..49b572fe 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorNecron.java @@ -16,12 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.utils.TextUtils; import net.minecraft.entity.boss.BossStatus; -import net.minecraft.entity.item.EntityArmorStand; -import net.minecraftforge.event.entity.living.LivingEvent; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorProf.java index d1ccd300..169b9773 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorProf.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraftforge.event.entity.living.LivingEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorSadan.java index 0de8795f..0de8aa56 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorSadan.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraftforge.event.entity.living.LivingEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorScarf.java index 2100d002..44fdea1b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorScarf.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.entity.item.EntityArmorStand; import net.minecraftforge.event.entity.living.LivingEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorThorn.java index ce76b270..eb5a71d6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/BossfightProcessorThorn.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.entity.boss.BossStatus; import net.minecraft.init.Blocks; @@ -40,8 +40,7 @@ public class BossfightProcessorThorn extends GeneralBossfightProcessor { addPhase(GeneralBossfightProcessor.PhaseData.builder() .phase("fight").build() ); - - w= DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext().getWorld(); + w= DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getWorld(); } private final Set<BlockPos> progressBar = new HashSet<BlockPos>(); private final World w; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/GeneralBossfightProcessor.java index e8ed8981..50fd9868 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/GeneralBossfightProcessor.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; -import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.BlockUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; import lombok.*; import net.minecraft.util.IChatComponent; import net.minecraft.world.World; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/HealthData.java index 065ab15f..ace9b39b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/HealthData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/bossfight/HealthData.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.bossfight; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java index 41cb633d..feeb7228 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java @@ -16,10 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.boxpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.boxpuzzle; -import lombok.AllArgsConstructor; -import lombok.Data; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java index bf81bf72..f4c80a57 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.boxpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.boxpuzzle; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessorGenerator; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -140,7 +140,7 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { if (calcDone2) { BoxPuzzleSolvingThread.Route semi_solution = puzzleSolvingThread.solution; if (semi_solution == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eBox Solver §7:: §cCouldn't find solution involving less than 20 box moves within 3m concurrent possibility")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eBox Solver §7:: §cCouldn't find solution involving less than 20 box moves within 3m concurrent possibility")); step = 0; calcDone2 = false; pathFindReq = true; @@ -150,7 +150,7 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { return; } else{ solution = semi_solution.boxMoves; - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eBox Solver §7:: Solution Found!")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §eBox Solver §7:: Solution Found!")); } step = 0; lastState = currboard; @@ -317,10 +317,10 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { if (chat.getFormattedText().toLowerCase().contains("recalc")) { if (calcDone) { calcReq = true; - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide :::: Recalculating Route...")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide :::: Recalculating Route...")); } else { calcReq = true; - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide :::: Currently Calculating Route...")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide :::: Currently Calculating Route...")); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java index c31ba753..94732dc9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java @@ -16,33 +16,27 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.icefill; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.icefill; -import kr.syeyoung.dungeonsguide.config.Config; -import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import net.minecraft.client.Minecraft; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessorGenerator; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; import java.awt.*; -import java.util.Queue; import java.util.Arrays; import java.util.LinkedList; import java.util.List; -import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArrayList; public class RoomProcessorIcePath2 extends GeneralRoomProcessor { private final List<List<BlockPos>> solution = new CopyOnWriteArrayList<List<BlockPos>>(); - private final Queue<String> messageQueue = new ConcurrentLinkedQueue<String>(); public RoomProcessorIcePath2(DungeonRoom dungeonRoom) { @@ -77,7 +71,7 @@ public class RoomProcessorIcePath2 extends GeneralRoomProcessor { public void run() { List<Point> hamiltonianPath = findFirstHamiltonianPath(map, startX, startY, endX, endY); if (hamiltonianPath == null) { - messageQueue.add("§eDungeons Guide §7:: §eIcePath §7:: §cCouldn't find solution for floor "+s); + ChatTransmitter.addToQueue("§eDungeons Guide §7:: §eIcePath §7:: §cCouldn't find solution for floor "+s); return; } hamiltonianPath.add(0,new Point(startX, startY)); @@ -99,9 +93,6 @@ public class RoomProcessorIcePath2 extends GeneralRoomProcessor { public void tick() { super.tick(); if (!FeatureRegistry.SOLVER_ICEPATH.isEnabled()) return; - while (!messageQueue.isEmpty()){ - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(messageQueue.poll())); - } } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/LeverState.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/LeverState.java index 54bfe3c8..e86fdd5c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/LeverState.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/LeverState.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/LeverStateContradict.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/LeverStateContradict.java index c9d5642e..a574d6bf 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/LeverStateContradict.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/LeverStateContradict.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; public class LeverStateContradict extends LeverState { public LeverStateContradict() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/RoomProcessorWaterPuzzle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/RoomProcessorWaterPuzzle.java index bc278f1f..d4b05bc9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/RoomProcessorWaterPuzzle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/RoomProcessorWaterPuzzle.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessorGenerator; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.util.BlockPos; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/Route.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/Route.java index 8a2ca544..a122d83f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/Route.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/Route.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes.WaterNodeEnd; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes.WaterNodeEnd; import lombok.Data; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/SwitchData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/SwitchData.java index df28846d..1b43448f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/SwitchData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/SwitchData.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes.WaterNodeStart; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes.WaterNodeToggleable; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes.WaterNodeStart; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes.WaterNodeToggleable; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.util.BlockPos; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/WaterBoard.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/WaterBoard.java index c2d1a187..56b372e4 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/WaterBoard.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/WaterBoard.java @@ -16,11 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes.*; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes.*; import lombok.Getter; import net.minecraft.block.Block; import net.minecraft.block.BlockLever; @@ -415,7 +416,7 @@ public class WaterBoard { private boolean isSwitchActive(SwitchData switchData) { BlockPos switch2 = switchData.getSwitchLoc(); World w= waterPuzzle.getDungeonRoom().getContext().getWorld(); - boolean bool = w.getBlockState(switch2).getValue(BlockLever.POWERED); + boolean bool = DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(switch2).getValue(BlockLever.POWERED); return bool; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/WaterNode.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/WaterNode.java index 69011818..cbcb1cb0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/WaterNode.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/WaterNode.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle; import net.minecraft.util.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeAir.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeAir.java index 28d57349..274a232b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeAir.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeAir.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.LeverState; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.WaterNode; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.LeverState; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.WaterNode; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeEnd.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeEnd.java index 54efdb09..3ca59934 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeEnd.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeEnd.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.LeverState; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.WaterNode; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.LeverState; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.WaterNode; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeStart.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeStart.java index 9c02c057..09ec7070 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeStart.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeStart.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.LeverState; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.WaterNode; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.LeverState; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.WaterNode; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeToggleable.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeToggleable.java index 9cbd6f9b..039c1cf9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeToggleable.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeToggleable.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.LeverState; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.WaterNode; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.LeverState; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.WaterNode; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeWall.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeWall.java index 8fc6241b..b09750f2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/waterpuzzle/nodes/WaterNodeWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/waterpuzzle/nodes/WaterNodeWall.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.nodes; +package kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.nodes; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.LeverState; -import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.WaterNode; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.LeverState; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.waterpuzzle.WaterNode; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/AuthChangedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/AuthChangedEvent.java new file mode 100644 index 00000000..f0fd11ee --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/AuthChangedEvent.java @@ -0,0 +1,6 @@ +package kr.syeyoung.dungeonsguide.mod.events.impl; + + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class AuthChangedEvent extends Event { } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/BlockUpdateEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/BlockUpdateEvent.java index e6e94dcc..41b9cace 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/BlockUpdateEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/BlockUpdateEvent.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; -import lombok.Data; import lombok.Getter; import lombok.Setter; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/BossroomEnterEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/BossroomEnterEvent.java index ecf57688..aeab26d9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/BossroomEnterEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/BossroomEnterEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/DiscordUserJoinRequestEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DiscordUserJoinRequestEvent.java index 80a9315a..28452eed 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/DiscordUserJoinRequestEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DiscordUserJoinRequestEvent.java @@ -16,14 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUser; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraftforge.fml.common.eventhandler.Event; -@Data @AllArgsConstructor +@Data +@EqualsAndHashCode(callSuper=false) +@AllArgsConstructor public class DiscordUserJoinRequestEvent extends Event { private DiscordUser discordUser; private boolean isInvite; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/DiscordUserUpdateEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DiscordUserUpdateEvent.java index f737b598..0a6e4385 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/DiscordUserUpdateEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DiscordUserUpdateEvent.java @@ -16,15 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; -import kr.syeyoung.dungeonsguide.rpc.JDiscordRelation; -import kr.syeyoung.dungeonsguide.rpc.JDiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.JDiscordRelation; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraftforge.fml.common.eventhandler.Event; -@Data @AllArgsConstructor +@Data +@EqualsAndHashCode(callSuper=false) +@AllArgsConstructor public class DiscordUserUpdateEvent extends Event { private JDiscordRelation prev, current; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonContextInitializationEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonContextInitializationEvent.java index dfd9ed6f..5d53dc5a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonContextInitializationEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonContextInitializationEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonEndedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonEndedEvent.java index 399d7013..8bfe89d0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonEndedEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonEndedEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonLeftEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonLeftEvent.java index 8e624516..c43fa94f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonLeftEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonLeftEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonStartedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonStartedEvent.java index 675adef1..3807524c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/DungeonStartedEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/DungeonStartedEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/HypixelJoinedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/HypixelJoinedEvent.java index c2f6b1d6..bab30968 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/HypixelJoinedEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/HypixelJoinedEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/KeyBindPressedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/KeyBindPressedEvent.java index c277b227..bdb5a41a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/KeyBindPressedEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/KeyBindPressedEvent.java @@ -16,13 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraftforge.fml.common.eventhandler.Event; -@Data @AllArgsConstructor +@Data +@EqualsAndHashCode(callSuper=false) +@AllArgsConstructor public class KeyBindPressedEvent extends Event { private int key; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/PlayerInteractEntityEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/PlayerInteractEntityEvent.java index 799e8102..6f549bcb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/PlayerInteractEntityEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/PlayerInteractEntityEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/PlayerListItemPacketEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/PlayerListItemPacketEvent.java index 65e936f0..e0f7b2c3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/PlayerListItemPacketEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/PlayerListItemPacketEvent.java @@ -16,14 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.network.play.server.S38PacketPlayerListItem; import net.minecraftforge.fml.common.eventhandler.Event; @Data +@EqualsAndHashCode(callSuper=false) @AllArgsConstructor public class PlayerListItemPacketEvent extends Event { private S38PacketPlayerListItem packetPlayerListItem; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/SkyblockJoinedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/SkyblockJoinedEvent.java index 937ae59c..27cb10c4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/SkyblockJoinedEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/SkyblockJoinedEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/SkyblockLeftEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/SkyblockLeftEvent.java index 3e9919be..529e251c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/SkyblockLeftEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/SkyblockLeftEvent.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/StompConnectedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/StompConnectedEvent.java index d7220b17..554197bb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/StompConnectedEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/StompConnectedEvent.java @@ -16,15 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; -import kr.syeyoung.dungeonsguide.stomp.StompInterface; +import kr.syeyoung.dungeonsguide.mod.stomp.StompClient; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraftforge.fml.common.eventhandler.Event; @Data +@EqualsAndHashCode(callSuper=false) @AllArgsConstructor public class StompConnectedEvent extends Event { - private StompInterface stompInterface; + private StompClient stompInterface; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/TitleEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/TitleEvent.java index ab164d9d..7450dcdc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/TitleEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/TitleEvent.java @@ -16,14 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.network.play.server.S45PacketTitle; import net.minecraftforge.fml.common.eventhandler.Event; @Data +@EqualsAndHashCode(callSuper=false) @AllArgsConstructor public class TitleEvent extends Event { S45PacketTitle packetTitle; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/events/WindowUpdateEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/WindowUpdateEvent.java index 4c1b1150..412b4d82 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/events/WindowUpdateEvent.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/impl/WindowUpdateEvent.java @@ -16,16 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.events; +package kr.syeyoung.dungeonsguide.mod.events.impl; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.network.play.server.S2FPacketSetSlot; import net.minecraft.network.play.server.S30PacketWindowItems; -import net.minecraft.network.play.server.S45PacketTitle; import net.minecraftforge.fml.common.eventhandler.Event; @Data +@EqualsAndHashCode(callSuper=false) @AllArgsConstructor public class WindowUpdateEvent extends Event { S30PacketWindowItems windowItems; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java new file mode 100755 index 00000000..247a9284 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java @@ -0,0 +1,513 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.events.listener; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.Config; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonActionContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonAddSet; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonParameterEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonRoomEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.mod.events.impl.*; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.utils.MapUtils; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.relauncher.Side; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; + +import java.awt.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class DungeonListener { + + + @SubscribeEvent + public void onWorldLoad(WorldEvent.Unload event) { + try { + Config.saveConfig(); + } catch (IOException e) { + e.printStackTrace(); + } + DungeonActionContext.getSpawnLocation().clear(); + DungeonActionContext.getKilleds().clear(); + } + + @SubscribeEvent + public void onPostDraw(GuiScreenEvent.DrawScreenEvent.Post e) { + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (context != null) { + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + if (thePlayer == null) { + return; + } + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().onPostGuiRender(e); + } + + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null && dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onPostGuiRender(e); + } + } + + GlStateManager.enableBlend(); + GlStateManager.color(1, 1, 1, 1); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableAlpha(); + } + + @SubscribeEvent + public void onEntityUpdate(LivingEvent.LivingUpdateEvent e) { + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context != null) { + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + if (thePlayer == null) return; + if (context.getBossfightProcessor() != null) context.getBossfightProcessor().onEntityUpdate(e); + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null && dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onEntityUpdate(e); + } + } + } + + @SubscribeEvent + public void onDungeonLeave(DungeonLeftEvent ev) { + DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(null); + if (!FeatureRegistry.ADVANCED_DEBUGGABLE_MAP.isEnabled()) { + MapUtils.clearMap(); + } + } + + + + + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent ev) { + if (ev.side == Side.SERVER || ev.phase != TickEvent.Phase.START) return; + + + if (SkyblockStatus.isOnSkyblock()) { + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context != null) { + context.getMapProcessor().tick(); + context.tick(); + } else { + if (SkyblockStatus.isOnDungeon()) { + DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(new DungeonContext(Minecraft.getMinecraft().thePlayer.worldObj)); + MinecraftForge.EVENT_BUS.post(new DungeonStartedEvent()); + } + } + } + + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (SkyblockStatus.isOnDungeon() && context != null) { + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + if (thePlayer == null) { + return; + } + + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().tick(); + } + + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + + if (dungeonRoom != null && dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().tick(); + } + + } + + } + + + @SubscribeEvent + public void onRender(RenderGameOverlayEvent.Post postRender) { + if (!(postRender.type == RenderGameOverlayEvent.ElementType.EXPERIENCE || postRender.type == RenderGameOverlayEvent.ElementType.JUMPBAR)) + return; + + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context != null) { + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + if (context.getBossfightProcessor() != null) + context.getBossfightProcessor().drawScreen(postRender.partialTicks); + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().drawScreen(postRender.partialTicks); + } + } + + } + GlStateManager.enableBlend(); + GlStateManager.color(1, 1, 1, 1); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + Minecraft.getMinecraft().entityRenderer.setupOverlayRendering(); + GlStateManager.enableAlpha(); + } + + @SubscribeEvent(receiveCanceled = true, priority = EventPriority.HIGHEST) + public void onChatReceived(ClientChatReceivedEvent clientChatReceivedEvent) { + if (!SkyblockStatus.isOnDungeon()) return; + + if (clientChatReceivedEvent.type != 2 && clientChatReceivedEvent.message.getFormattedText().contains("§6> §e§lEXTRA STATS §6<")) { + MinecraftForge.EVENT_BUS.post(new DungeonEndedEvent()); + } + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (context != null) { + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + context.onChat(clientChatReceivedEvent); + + if (context.getBossfightProcessor() != null) { + if (clientChatReceivedEvent.type == 2) { + context.getBossfightProcessor().actionbarReceived(clientChatReceivedEvent.message); + } else { + context.getBossfightProcessor().chatReceived(clientChatReceivedEvent.message); + } + } + + RoomProcessor roomProcessor = null; + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + if (clientChatReceivedEvent.type == 2) { + dungeonRoom.getRoomProcessor().actionbarReceived(clientChatReceivedEvent.message); + roomProcessor = dungeonRoom.getRoomProcessor(); + } else { + dungeonRoom.getRoomProcessor().chatReceived(clientChatReceivedEvent.message); + roomProcessor = dungeonRoom.getRoomProcessor(); + } + } + } + if (clientChatReceivedEvent.type == 2) { + return; + } + for (RoomProcessor globalRoomProcessor : context.getGlobalRoomProcessors()) { + if (globalRoomProcessor != roomProcessor) { + globalRoomProcessor.chatReceived(clientChatReceivedEvent.message); + } + } + } + } + + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent renderWorldLastEvent) { + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context == null) { + return; + } + + if (FeatureRegistry.DEBUG.isEnabled()) { + for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { + for (DungeonDoor door : dungeonRoom.getDoors()) { + RenderUtils.renderDoor(door, renderWorldLastEvent.partialTicks); + } + } + } + + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().drawWorld(renderWorldLastEvent.partialTicks); + } + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().drawWorld(renderWorldLastEvent.partialTicks); + } + } + + if (FeatureRegistry.DEBUG.isEnabled() && dungeonRoom != null) { + + Vec3 player = Minecraft.getMinecraft().thePlayer.getPositionVector(); + BlockPos real = new BlockPos(player.xCoord * 2, player.yCoord * 2, player.zCoord * 2); + for (BlockPos allInBox : BlockPos.getAllInBox(real.add(-1, -1, -1), real.add(1, 1, 1))) { + boolean blocked = dungeonRoom.isBlocked(allInBox.getX(), allInBox.getY(), allInBox.getZ()); + + RenderUtils.highlightBox( + AxisAlignedBB.fromBounds( + allInBox.getX() / 2.0 - 0.1, allInBox.getY() / 2.0 - 0.1, allInBox.getZ() / 2.0 - 0.1, + allInBox.getX() / 2.0 + 0.1, allInBox.getY() / 2.0 + 0.1, allInBox.getZ() / 2.0 + 0.1 + ), blocked ? new Color(0x55FF0000, true) : new Color(0x3300FF00, true), renderWorldLastEvent.partialTicks, false); + + } + } + + if (EditingContext.getEditingContext() != null) { + GuiScreen guiScreen = EditingContext.getEditingContext().getCurrent(); + if (guiScreen instanceof GuiDungeonParameterEdit) { + ValueEdit valueEdit = ((GuiDungeonParameterEdit) guiScreen).getValueEdit(); + if (valueEdit != null) { + valueEdit.renderWorld(renderWorldLastEvent.partialTicks); + } + } else if (guiScreen instanceof GuiDungeonValueEdit) { + ValueEdit valueEdit = ((GuiDungeonValueEdit) guiScreen).getValueEdit(); + if (valueEdit != null) { + valueEdit.renderWorld(renderWorldLastEvent.partialTicks); + } + } else if (guiScreen instanceof GuiDungeonAddSet) { + ((GuiDungeonAddSet) guiScreen).onWorldRender(renderWorldLastEvent.partialTicks); + } + } + } + + @SubscribeEvent() + public void onKey2(KeyBindPressedEvent keyInputEvent) { + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null) { + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().onKeybindPress(keyInputEvent); + } + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onKeybindPress(keyInputEvent); + } + } + } + } + + @SubscribeEvent() + public void onInteract(PlayerInteractEntityEvent interact) { + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null) { + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().onInteract(interact); + } + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onInteract(interact); + } + } + } + } + + + String getCurrentRoomName(){ + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(player.getPosition()); + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + String in = "unknown"; + if (dungeonRoom != null){ + in = dungeonRoom.getDungeonRoomInfo().getName(); + } + + return in; + } + + @SubscribeEvent + public void onBlockChange(BlockUpdateEvent.Post postInteract) { + if (!SkyblockStatus.isOnDungeon()) return; + + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null) { + + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().onBlockUpdate(postInteract); + } + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onBlockUpdate(postInteract); + } + } + } + } + + @SubscribeEvent + public void onKeyInput(KeyBindPressedEvent keyInputEvent) { + if (FeatureRegistry.DEBUG.isEnabled() && FeatureRegistry.ADVANCED_ROOMEDIT.isEnabled() && keyInputEvent.getKey() == FeatureRegistry.ADVANCED_ROOMEDIT.<Integer>getParameter("key").getValue()) { + EditingContext ec = EditingContext.getEditingContext(); + if (ec == null) { + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context == null) { + ChatTransmitter.addToQueue(new ChatComponentText("Not in dungeons")); + return; + } + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + + if (dungeonRoom == null) { + ChatTransmitter.addToQueue(new ChatComponentText("Can't determine the dungeon room you're in")); + return; + } + + if (EditingContext.getEditingContext() != null) { + ChatTransmitter.addToQueue(new ChatComponentText("There is an editing session currently open.")); + return; + } + + EditingContext.createEditingContext(dungeonRoom); + EditingContext.getEditingContext().openGui(new GuiDungeonRoomEdit(dungeonRoom)); + } else ec.reopen(); + } + } + + @SubscribeEvent + public void onInteract(PlayerInteractEvent keyInputEvent) { + if (!keyInputEvent.world.isRemote) return; + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (context != null) { + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().onInteractBlock(keyInputEvent); + } + + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onInteractBlock(keyInputEvent); + } + } + } + } + + @Getter + private final Map<Integer, Vec3> entityIdToPosMap = new HashMap<>(); + + @SubscribeEvent + public void onEntitySpawn(EntityJoinWorldEvent spawn) { + DungeonActionContext.getSpawnLocation().put(spawn.entity.getEntityId(), new Vec3(spawn.entity.posX, spawn.entity.posY, spawn.entity.posZ)); + } + + + @SubscribeEvent + public void onEntityDeSpawn(LivingDeathEvent deathEvent) { + if (deathEvent.entityLiving instanceof EntityBat) + DungeonActionContext.getKilleds().add(deathEvent.entity.getEntityId()); + + if (!SkyblockStatus.isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade() != null) { + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().onEntityDeath(deathEvent); + } + DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); + if (dungeonRoom != null) { + if (dungeonRoom.getRoomProcessor() != null) { + dungeonRoom.getRoomProcessor().onEntityDeath(deathEvent); + } + } + } + + if (!(deathEvent.entityLiving instanceof EntityBat)) + DungeonActionContext.getSpawnLocation().remove(deathEvent.entity.getEntityId()); + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/FeatureListener.java index a3e8faa3..c15d107c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/FeatureListener.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.eventlistener; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.events.*; -import kr.syeyoung.dungeonsguide.features.*; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.listener.*; +package kr.syeyoung.dungeonsguide.mod.events.listener; + +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.events.impl.*; +import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.*; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraftforge.client.event.*; @@ -42,8 +42,8 @@ public class FeatureListener { boolean isLocConfig = Minecraft.getMinecraft().currentScreen instanceof GuiGuiLocationConfig; if (!(postRender.type == RenderGameOverlayEvent.ElementType.EXPERIENCE || postRender.type == RenderGameOverlayEvent.ElementType.JUMPBAR)) return; - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof ScreenRenderListener && (!isLocConfig || !(abstractFeature instanceof GuiFeature))) { @@ -132,8 +132,8 @@ public class FeatureListener { @SubscribeEvent public void onWindowUpdate(WindowUpdateEvent windowUpdateEvent) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof GuiUpdateListener) { ((GuiUpdateListener) abstractFeature).onGuiUpdate(windowUpdateEvent); @@ -146,8 +146,8 @@ public class FeatureListener { @SubscribeEvent public void onRender(RenderLivingEvent.Pre preRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof EntityLivingRenderListener) { @@ -162,8 +162,8 @@ public class FeatureListener { @SubscribeEvent public void onSound(PlaySoundEvent soundEvent) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof SoundListener) { @@ -178,8 +178,8 @@ public class FeatureListener { @SubscribeEvent public void onRender(RenderLivingEvent.Post preRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof EntityLivingRenderListener) { @@ -193,8 +193,8 @@ public class FeatureListener { @SubscribeEvent public void onRender(TitleEvent titleEvent) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof TitleListener) { @@ -208,8 +208,8 @@ public class FeatureListener { @SubscribeEvent public void onRender(RenderPlayerEvent.Pre preRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof PlayerRenderListener) { @@ -223,8 +223,8 @@ public class FeatureListener { @SubscribeEvent public void onRender(RenderPlayerEvent.Post preRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof PlayerRenderListener) { @@ -240,8 +240,8 @@ public class FeatureListener { @SubscribeEvent public void onRenderWorld(RenderWorldLastEvent postRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof WorldRenderListener) { @@ -255,8 +255,8 @@ public class FeatureListener { @SubscribeEvent public void onInteract(PlayerInteractEvent postRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof InteractListener) { @@ -272,8 +272,8 @@ public class FeatureListener { @SubscribeEvent public void onRenderWorld(ClientChatReceivedEvent postRender) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof ChatListener) { @@ -301,8 +301,8 @@ public class FeatureListener { @SubscribeEvent public void dungeonTooltip(ItemTooltipEvent event) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof TooltipListener) { @@ -318,8 +318,8 @@ public class FeatureListener { public void onTick(TickEvent.ClientTickEvent tick) { if (tick.phase == TickEvent.Phase.END && tick.type == TickEvent.Type.CLIENT ) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof TickListener) { @@ -334,8 +334,8 @@ public class FeatureListener { @SubscribeEvent public void onGuiOpen(GuiOpenEvent tick) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof GuiOpenListener) { @@ -349,8 +349,8 @@ public class FeatureListener { @SubscribeEvent public void onGuiRender(GuiScreenEvent.DrawScreenEvent.Post render) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof GuiPostRenderListener) { @@ -365,8 +365,8 @@ public class FeatureListener { @SubscribeEvent public void onGuiRender(GuiScreenEvent.DrawScreenEvent.Pre render) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof GuiPreRenderListener) { @@ -381,8 +381,8 @@ public class FeatureListener { @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent render) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof GuiBackgroundRenderListener) { @@ -398,8 +398,8 @@ public class FeatureListener { @SubscribeEvent(receiveCanceled = true, priority = EventPriority.HIGH) public void onGuiEvent(GuiScreenEvent.MouseInputEvent.Pre input) { try { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnSkyblock()) return; + + if (!SkyblockStatus.isOnSkyblock()) return; for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { if (abstractFeature instanceof GuiClickListener) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/PacketListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java index 759ecca9..3a622dcf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/PacketListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java @@ -16,17 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.eventlistener; +package kr.syeyoung.dungeonsguide.mod.events.listener; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.cosmetics.CustomPacketPlayerListItem; -import kr.syeyoung.dungeonsguide.events.*; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CustomPacketPlayerListItem; +import kr.syeyoung.dungeonsguide.mod.events.impl.BlockUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.PlayerInteractEntityEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.TitleEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.WindowUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.network.Packet; @@ -107,13 +110,20 @@ public class PacketListener extends ChannelDuplexHandler { @Override public void processPacket(INetHandlerPlayClient handler) { + BlockUpdateEvent blockUpdateEvent = new BlockUpdateEvent.Pre(); blockUpdateEvent.getUpdatedBlocks().add(new Tuple<>(getBlockPosition(),getBlockState())); - MinecraftForge.EVENT_BUS.post(blockUpdateEvent); + + + MinecraftForge.EVENT_BUS.post(blockUpdateEvent); super.processPacket(handler); blockUpdateEvent = new BlockUpdateEvent.Post(); blockUpdateEvent.getUpdatedBlocks().add(new Tuple<>(getBlockPosition(), getBlockState())); - MinecraftForge.EVENT_BUS.post(blockUpdateEvent); + MinecraftForge.EVENT_BUS.post(blockUpdateEvent); + + + + } @Override @@ -135,17 +145,21 @@ public class PacketListener extends ChannelDuplexHandler { } @Override public void processPacket(INetHandlerPlayClient handler) { + + BlockUpdateEvent blockUpdateEvent = new BlockUpdateEvent.Pre(); for (S22PacketMultiBlockChange.BlockUpdateData changedBlock : getChangedBlocks()) { blockUpdateEvent.getUpdatedBlocks().add(new Tuple<>(changedBlock.getPos(), changedBlock.getBlockState())); } - MinecraftForge.EVENT_BUS.post(blockUpdateEvent); + MinecraftForge.EVENT_BUS.post(blockUpdateEvent); super.processPacket(handler); blockUpdateEvent = new BlockUpdateEvent.Post(); for (S22PacketMultiBlockChange.BlockUpdateData changedBlock : getChangedBlocks()) { blockUpdateEvent.getUpdatedBlocks().add(new Tuple<>(changedBlock.getPos(), changedBlock.getBlockState())); } - MinecraftForge.EVENT_BUS.post(blockUpdateEvent); + MinecraftForge.EVENT_BUS.post(blockUpdateEvent); + + } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractFeature.java index 23b76546..92d0bde3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractFeature.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features; +package kr.syeyoung.dungeonsguide.mod.features; import com.google.common.base.Supplier; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.config.types.TypeConverter; -import kr.syeyoung.dungeonsguide.config.types.TypeConverterRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.config.types.TypeConverter; +import kr.syeyoung.dungeonsguide.mod.config.types.TypeConverterRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; @@ -47,6 +47,11 @@ public abstract class AbstractFeature { protected Map<String, FeatureParameter> parameters = new HashMap<String, FeatureParameter>(); + protected void addParameter(String name, FeatureParameter f){ + parameters.put(name, f); + } + + protected AbstractFeature(String category, String name, String description, String key) { this.category = category; this.name = name; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureParameter.java index f5a2133a..30559d8a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureParameter.java @@ -16,28 +16,42 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features; +package kr.syeyoung.dungeonsguide.mod.features; -import kr.syeyoung.dungeonsguide.config.types.TypeConverter; -import kr.syeyoung.dungeonsguide.config.types.TypeConverterRegistry; +import kr.syeyoung.dungeonsguide.mod.config.types.TypeConverter; +import kr.syeyoung.dungeonsguide.mod.config.types.TypeConverterRegistry; import lombok.AllArgsConstructor; import lombok.Data; +import java.util.function.Consumer; + @Data @AllArgsConstructor public class FeatureParameter<T> { private String key; - private String name; private String description; - private T value; + + private T default_value; private String value_type; + private Consumer<T> changedCallback; public FeatureParameter(String key, String name, String description, T default_value, String value_type) { - this.key = key; this.name = name; this.default_value = default_value; - this.description = description; this.value_type = value_type; + this(key, name, description,default_value, value_type, null); + } + + public FeatureParameter(String key, String name, String description, T default_value, String value_type, Consumer<T> changedCallback) { + this.key = key; + this.name = name; + this.default_value = default_value; + this.description = description; + this.value_type = value_type; + if(changedCallback != null){ + this.changedCallback = changedCallback; + changedCallback.accept(default_value); + } } public void setToDefault() { @@ -48,4 +62,11 @@ public class FeatureParameter<T> { public T getValue() { return value == null ? default_value : value; } + + public void setValue(T newValue){ + value = newValue; + if(changedCallback != null){ + changedCallback.accept(value); + } + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java new file mode 100644 index 00000000..b8ff6bbc --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java @@ -0,0 +1,337 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.features; + +import kr.syeyoung.dungeonsguide.mod.features.impl.advanced.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.boss.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal.FeatureSimonSaysSolver; +import kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal.FeatureTerminalSolvers; +import kr.syeyoung.dungeonsguide.mod.features.impl.cosmetics.FeatureNicknameColor; +import kr.syeyoung.dungeonsguide.mod.features.impl.cosmetics.FeatureNicknamePrefix; +import kr.syeyoung.dungeonsguide.mod.features.impl.discord.inviteViewer.PartyInviteViewer; +import kr.syeyoung.dungeonsguide.mod.features.impl.discord.onlinealarm.PlayingDGAlarm; +import kr.syeyoung.dungeonsguide.mod.features.impl.dungeon.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.etc.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.etc.ability.FeatureAbilityCooldown; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.APIKey; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.FeaturePartyList; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.FeaturePartyReady; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.customgui.FeatureCustomPartyFinder; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; +import kr.syeyoung.dungeonsguide.mod.features.impl.secret.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser.FeatureMechanicBrowse; +import kr.syeyoung.dungeonsguide.mod.features.impl.solvers.*; +import lombok.Getter; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FeatureRegistry { + @Getter + private static final List<AbstractFeature> featureList = new ArrayList<AbstractFeature>(); + private static final Map<String, AbstractFeature> featureByKey = new HashMap<String, AbstractFeature>(); + @Getter + private static final Map<String, List<AbstractFeature>> featuresByCategory = new HashMap<String, List<AbstractFeature>>(); + @Getter + private static final Map<String, String> categoryDescription = new HashMap<>(); + + public static AbstractFeature getFeatureByKey(String key) { + return featureByKey.get(key); + } + + public static <T extends AbstractFeature> T register(T abstractFeature) { + if (featureByKey.containsKey(abstractFeature.getKey())) throw new IllegalArgumentException("DUPLICATE FEATURE DEFINITION"); + featureList.add(abstractFeature); + featureByKey.put(abstractFeature.getKey(), abstractFeature); + List<AbstractFeature> features = featuresByCategory.get(abstractFeature.getCategory()); + if (features == null) + features = new ArrayList<AbstractFeature>(); + features.add(abstractFeature); + featuresByCategory.put(abstractFeature.getCategory(), features); + + return abstractFeature; + } + + + + public static PathfindLineProperties SECRET_LINE_PROPERTIES_GLOBAL; + + public static FeatureMechanicBrowse SECRET_BROWSE; + public static PathfindLineProperties SECRET_LINE_PROPERTIES_SECRET_BROWSER; + public static FeatureActions SECRET_ACTIONS; + + public static FeaturePathfindStrategy SECRET_PATHFIND_STRATEGY; + public static FeatureTogglePathfind SECRET_TOGGLE_KEY; + public static FeatureFreezePathfind SECRET_FREEZE_LINES; + public static FeatureCreateRefreshLine SECRET_CREATE_REFRESH_LINE; + + public static SimpleFeature SECRET_AUTO_BROWSE_NEXT; + public static SimpleFeature SECRET_AUTO_START; + public static SimpleFeature SECRET_NEXT_KEY; + + public static SimpleFeature SECRET_BLOOD_RUSH; + public static PathfindLineProperties SECRET_BLOOD_RUSH_LINE_PROPERTIES; + + + public static PathfindLineProperties SECRET_LINE_PROPERTIES_AUTOPATHFIND; + + public static FeaturePathfindToAll SECRET_PATHFIND_ALL; + public static PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT; + + public static PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_BAT; + public static PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_CHEST; + public static PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_ESSENCE; + public static PathfindLineProperties SECRET_LINE_PROPERTIES_PATHFINDALL_ITEM_DROP; + + public static FeatureSolverRiddle SOLVER_RIDDLE; + public static FeatureSolverTictactoe SOLVER_TICTACTOE; + public static SimpleFeature SOLVER_WATERPUZZLE; + public static SimpleFeature SOLVER_CREEPER; + public static FeatureSolverTeleport SOLVER_TELEPORT; + public static FeatureSolverBlaze SOLVER_BLAZE; + public static FeatureSolverIcefill SOLVER_ICEPATH; + public static FeatureSolverSilverfish SOLVER_SILVERFISH; + public static FeatureSolverBox SOLVER_BOX; + public static FeatureSolverKahoot SOLVER_KAHOOT; + public static FeatureSolverBombdefuse SOLVER_BOMBDEFUSE; + + + public static FeatureDungeonMap DUNGEON_MAP; + public static FeatureTestPepole TEST_PEPOLE; + public static FeatureDungeonRoomName DUNGEON_ROOMNAME; + public static FeaturePressAnyKeyToCloseChest DUNGEON_CLOSECHEST; + public static FeatureBoxSkelemaster DUNGEON_BOXSKELEMASTER; + public static FeatureBoxBats DUNGEON_BOXBAT; + public static FeatureBoxStarMobs DUNGEON_BOXSTARMOBS; + public static FeatureWatcherWarning DUNGEON_WATCHERWARNING; + public static FeatureDungeonDeaths DUNGEON_DEATHS; + public static FeatureDungeonMilestone DUNGEON_MILESTONE; + public static FeatureDungeonRealTime DUNGEON_REALTIME; + public static FeatureDungeonSBTime DUNGEON_SBTIME; + public static FeatureDungeonSecrets DUNGEON_SECRETS; + public static FeatureDungeonCurrentRoomSecrets DUNGEON_SECRETS_ROOM; + public static FeatureDungeonTombs DUNGEON_TOMBS; + public static FeatureDungeonScore DUNGEON_SCORE; + public static FeatureWarnLowHealth DUNGEON_LOWHEALTH_WARN; + public static SimpleFeature DUNGEON_INTERMODCOMM; + public static FeaturePlayerESP DUNGEON_PLAYERESP; + public static FeatureHideNameTags DUNGEON_HIDENAMETAGS; + public static FeatureSoulRoomWarning DUNGEON_FAIRYSOUL; + + public static FeatureWarningOnPortal BOSSFIGHT_WARNING_ON_PORTAL; + public static SimpleFeature BOSSFIGHT_CHESTPRICE; + public static FeatureAutoReparty BOSSFIGHT_AUTOREPARTY; + public static FeatureBossHealth BOSSFIGHT_HEALTH; + public static FeatureHideAnimals BOSSFIGHT_HIDE_ANIMALS; + public static FeatureThornBearPercentage BOSSFIGHT_BEAR_PERCENT; + public static FeatureThornSpiritBowTimer BOSSFIGHT_BOW_TIMER; + public static FeatureBoxRealLivid BOSSFIGHT_BOX_REALLIVID; + public static FeatureTerracotaTimer BOSSFIGHT_TERRACOTTA_TIMER; + public static FeatureCurrentPhase BOSSFIGHT_CURRENT_PHASE; + public static FeatureTerminalSolvers BOSSFIGHT_TERMINAL_SOLVERS; + public static FeatureSimonSaysSolver BOSSFIGHT_SIMONSAYS_SOLVER; + + public static APIKey PARTYKICKER_APIKEY; + public static FeatureViewPlayerStatsOnJoin PARTYKICKER_VIEWPLAYER; + public static FeatureCustomPartyFinder PARTYKICKER_CUSTOM; + public static FeaturePartyList PARTY_LIST; + public static FeaturePartyReady PARTY_READY; + + public static FeatureTooltipDungeonStat ETC_DUNGEONSTAT; + public static FeatureTooltipPrice ETC_PRICE; + public static FeatureAbilityCooldown ETC_ABILITY_COOLDOWN; + public static FeatureCooldownCounter ETC_COOLDOWN; + public static FeatureRepartyCommand ETC_REPARTY; + public static FeatureDecreaseExplosionSound ETC_EXPLOSION_SOUND; + public static FeatureAutoAcceptReparty ETC_AUTO_ACCEPT_REPARTY; + public static FeatureUpdateAlarm ETC_TEST; + + public static SimpleFeature FIX_SPIRIT_BOOTS; + public static FeatureDisableMessage FIX_MESSAGES; + + public static FeatureCopyMessages ETC_COPY_MSG; + + public static FeatureEpicCountdown EPIC_COUNTDOWN; + + public static FeaturePenguins ETC_PENGUIN; + + public static FeatureCollectScore ETC_COLLECT_SCORE; + + + + + + public static FeatureNicknamePrefix COSMETIC_PREFIX; + public static FeatureNicknameColor COSMETIC_NICKNAMECOLOR; + + + + public static SimpleFeature DISCORD_RICHPRESENCE; + public static PartyInviteViewer DISCORD_ASKTOJOIN; + public static PlayingDGAlarm DISCORD_ONLINEALARM; + public static SimpleFeature DISCORD_DONOTUSE; + + + public static SimpleFeature DEBUG; + public static SimpleFeature ADVANCED_ROOMEDIT; + + public static FeatureRoomDebugInfo ADVANCED_DEBUG_ROOM; + + public static FeatureDebuggableMap ADVANCED_DEBUGGABLE_MAP; + + public static FeatureRoomCoordDisplay ADVANCED_COORDS; + + private static FeatureDebugTrap ADVANCED_BAT; + + public static SimpleFeature RENDER_BREACONS; + + public static SimpleFeature RENDER_DESTENATION_TEXT; + + public static SimpleFeature DEBUG_BLOCK_CACHING; + + public void init(){ + try { + SECRET_LINE_PROPERTIES_GLOBAL = register(new PathfindLineProperties("Dungeon.Secrets.Preferences", "Global Line Settings", "Global Line Settings", "secret.lineproperties.global", true, null)); + SECRET_CREATE_REFRESH_LINE = register(new FeatureCreateRefreshLine()); + SECRET_FREEZE_LINES = register(new FeatureFreezePathfind()); + SECRET_TOGGLE_KEY = register(new FeatureTogglePathfind()); + SECRET_PATHFIND_STRATEGY = register(new FeaturePathfindStrategy()); + SECRET_ACTIONS = register(new FeatureActions()); + SECRET_LINE_PROPERTIES_SECRET_BROWSER = register(new PathfindLineProperties("Dungeon.Secrets.Secret Browser", "Line Settings", "Line Settings when pathfinding using Secret Browser", "secret.lineproperties.secretbrowser", true, SECRET_LINE_PROPERTIES_GLOBAL)); + SECRET_BROWSE = register(new FeatureMechanicBrowse()); + categoryDescription.put("ROOT.Secrets.Keybinds", "Useful keybinds / Toggle Pathfind lines, Freeze Pathfind lines, Refresh pathfind line or Trigger pathfind (you would want to use it, if you're using Pathfind to All)"); + SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT = register(new PathfindLineProperties("Dungeon.Secrets.Pathfind To All", "Parent Line Settings", "Line Settings to be used by default", "secret.lineproperties.apf.parent", false, SECRET_LINE_PROPERTIES_GLOBAL)); + DUNGEON_FAIRYSOUL = register(new FeatureSoulRoomWarning()); + DUNGEON_HIDENAMETAGS = register(new FeatureHideNameTags()); + DUNGEON_PLAYERESP = register(new FeaturePlayerESP()); + DUNGEON_INTERMODCOMM = register(new SimpleFeature("Dungeon.Teammates", "Communicate With Other's Dungeons Guide", "Sends total secret in the room to others\nSo that they can use the data to calculate total secret in dungeon run\n\nThis automates player chatting action, (chatting data) Thus it might be against hypixel's rules.\nBut mods like auto-gg which also automate player action and is kinda allowed mod exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "dungeon.intermodcomm", false)); + DUNGEON_LOWHEALTH_WARN = register(new FeatureWarnLowHealth()); + DUNGEON_SCORE = register(new FeatureDungeonScore()); + DUNGEON_TOMBS = register(new FeatureDungeonTombs()); + DUNGEON_SECRETS_ROOM = register(new FeatureDungeonCurrentRoomSecrets()); + DUNGEON_SECRETS = register(new FeatureDungeonSecrets()); + DUNGEON_SBTIME = register(new FeatureDungeonSBTime()); + DUNGEON_REALTIME = register(new FeatureDungeonRealTime()); + DUNGEON_MILESTONE = register(new FeatureDungeonMilestone()); + DUNGEON_DEATHS = register(new FeatureDungeonDeaths()); + DUNGEON_WATCHERWARNING = register(new FeatureWatcherWarning()); + DUNGEON_BOXSTARMOBS = register(new FeatureBoxStarMobs()); + DUNGEON_BOXBAT = register(new FeatureBoxBats()); + DUNGEON_BOXSKELEMASTER = register(new FeatureBoxSkelemaster()); + DUNGEON_CLOSECHEST = register(new FeaturePressAnyKeyToCloseChest()); + DUNGEON_ROOMNAME = register(new FeatureDungeonRoomName()); +// TEST_PEPOLE = register(new FeatureTestPepole()); + DUNGEON_MAP = register(new FeatureDungeonMap()); + SOLVER_BOMBDEFUSE = register(new FeatureSolverBombdefuse()); + SOLVER_KAHOOT = register(new FeatureSolverKahoot()); + SOLVER_BOX = register(new FeatureSolverBox()); + SOLVER_SILVERFISH = register(new FeatureSolverSilverfish()); + SOLVER_ICEPATH = register(new FeatureSolverIcefill()); + SOLVER_BLAZE = register(new FeatureSolverBlaze()); + SOLVER_TELEPORT = register(new FeatureSolverTeleport()); + SOLVER_CREEPER = register(new SimpleFeature("Dungeon.Solvers.Any Floor", "Creeper", "Draws line between prismarine lamps in creeper room", "solver.creeper")); + SOLVER_WATERPUZZLE = register(new SimpleFeature("Dungeon.Solvers.Any Floor", "Waterboard (Advanced)", "Calculates solution for waterboard puzzle and displays it to user", "solver.waterboard")); + SOLVER_TICTACTOE = register(new FeatureSolverTictactoe()); + SOLVER_RIDDLE = register(new FeatureSolverRiddle()); + SECRET_LINE_PROPERTIES_PATHFINDALL_ITEM_DROP = register(new PathfindLineProperties("Dungeon.Secrets.Pathfind To All", "Item Drop Line Settings", "Line Settings when pathfind to Item Drop, when using above feature", "secret.lineproperties.apf.itemdrop", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); + SECRET_LINE_PROPERTIES_PATHFINDALL_ESSENCE = register(new PathfindLineProperties("Dungeon.Secrets.Pathfind To All", "Essence Line Settings", "Line Settings when pathfind to Essence, when using above feature", "secret.lineproperties.apf.essence", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); + SECRET_LINE_PROPERTIES_PATHFINDALL_CHEST = register(new PathfindLineProperties("Dungeon.Secrets.Pathfind To All", "Chest Line Settings", "Line Settings when pathfind to Chest, when using above feature", "secret.lineproperties.apf.chest", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); + SECRET_LINE_PROPERTIES_PATHFINDALL_BAT = register(new PathfindLineProperties("Dungeon.Secrets.Pathfind To All", "Bat Line Settings", "Line Settings when pathfind to Bat, when using above feature", "secret.lineproperties.apf.bat", true, SECRET_LINE_PROPERTIES_PATHFINDALL_PARENT)); + SECRET_PATHFIND_ALL = register(new FeaturePathfindToAll()); + SECRET_LINE_PROPERTIES_AUTOPATHFIND = register(new PathfindLineProperties("Dungeon.Secrets.Legacy AutoPathfind", "Line Settings", "Line Settings when pathfinding using above features", "secret.lineproperties.autopathfind", true, SECRET_LINE_PROPERTIES_GLOBAL)); + SECRET_BLOOD_RUSH_LINE_PROPERTIES = register(new PathfindLineProperties("Dungeon.Secrets.Blood Rush", "Blood Rush Line Settings", "Line Settings to be used", "secret.lineproperties.bloodrush", false, SECRET_LINE_PROPERTIES_GLOBAL)); + SECRET_BLOOD_RUSH = register(new FeatureBloodRush()); + SECRET_NEXT_KEY = register(new SimpleFeature("Dungeon.Secrets.Legacy AutoPathfind", "Auto Pathfind to new secret upon pressing a key", "Auto browse the best next secret when you press key.\nPress settings to edit the key", "secret.keyfornext", false) {{ + addParameter("key", new FeatureParameter<Integer>("key", "Key", "Press to navigate to next best secret", Keyboard.KEY_NONE, "keybind")); + }}); + + EPIC_COUNTDOWN = register(new FeatureEpicCountdown()); + + RENDER_BREACONS = register(new SimpleFeature("Dungeon.Secrets.Preferences", "Render beacons", "Should the mod not render beacons on secret", "secret.beacons", false)); + DEBUG_BLOCK_CACHING = register(new SimpleFeature("Debug","Enable block getBlockCaching", "Cache all world.getBlockState callls", "debug.blockcache")); + RENDER_DESTENATION_TEXT = register(new SimpleFeature("Dungeon.Secrets.Preferences", "Render Destination text", "Should the mod not render \"destination\" on secrets", "secret.desttext", false)); + SECRET_AUTO_START = register(new SimpleFeature("Dungeon.Secrets.Legacy AutoPathfind", "Auto pathfind to new secret", "Auto browse best secret upon entering the room.", "secret.autouponenter", false)); + SECRET_AUTO_BROWSE_NEXT = register(new SimpleFeature("Dungeon.Secrets.Legacy AutoPathfind", "Auto Pathfind to next secret", "Auto browse best next secret after current one completes.\nthe first pathfinding of first secret needs to be triggered first in order for this option to work", "secret.autobrowse", false)); + BOSSFIGHT_WARNING_ON_PORTAL = register(new FeatureWarningOnPortal()); + BOSSFIGHT_CHESTPRICE = register(new FeatureChestPrice()); + BOSSFIGHT_AUTOREPARTY = register(new FeatureAutoReparty()); + BOSSFIGHT_HEALTH = register(new FeatureBossHealth()); + BOSSFIGHT_HIDE_ANIMALS = register(new FeatureHideAnimals()); + BOSSFIGHT_BEAR_PERCENT = register(new FeatureThornBearPercentage()); + BOSSFIGHT_BOW_TIMER = register(new FeatureThornSpiritBowTimer()); + BOSSFIGHT_BOX_REALLIVID = register(new FeatureBoxRealLivid()); + BOSSFIGHT_TERRACOTTA_TIMER = register(new FeatureTerracotaTimer()); + BOSSFIGHT_CURRENT_PHASE = register(new FeatureCurrentPhase()); + BOSSFIGHT_TERMINAL_SOLVERS = register(new FeatureTerminalSolvers()); + BOSSFIGHT_SIMONSAYS_SOLVER = register(new FeatureSimonSaysSolver()); + PARTYKICKER_APIKEY = register(new APIKey()); + PARTYKICKER_VIEWPLAYER = register(new FeatureViewPlayerStatsOnJoin()); + PARTYKICKER_CUSTOM = register(new FeatureCustomPartyFinder()); + PARTY_LIST = register(new FeaturePartyList()); + PARTY_READY = register(new FeaturePartyReady()); + ETC_DUNGEONSTAT = register(new FeatureTooltipDungeonStat()); + ETC_PRICE = register(new FeatureTooltipPrice()); + ETC_ABILITY_COOLDOWN = register(new FeatureAbilityCooldown()); + ETC_COOLDOWN = register(new FeatureCooldownCounter()); + ETC_REPARTY = register(new FeatureRepartyCommand()); + ETC_EXPLOSION_SOUND = register(new FeatureDecreaseExplosionSound()); + ETC_AUTO_ACCEPT_REPARTY = register(new FeatureAutoAcceptReparty()); + ETC_TEST = register(new FeatureUpdateAlarm()); + FIX_SPIRIT_BOOTS = register(new SimpleFeature("Misc", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true)); + FIX_MESSAGES = register(new FeatureDisableMessage()); + ETC_COPY_MSG = register(new FeatureCopyMessages()); + ETC_PENGUIN = register(new FeaturePenguins()); + ETC_COLLECT_SCORE = register(new FeatureCollectScore()); + COSMETIC_NICKNAMECOLOR = register(new FeatureNicknameColor()); + COSMETIC_PREFIX = register(new FeatureNicknamePrefix()); + DISCORD_RICHPRESENCE = register(new SimpleFeature("Discord", "Discord RPC", "Enable Discord rich presence", "advanced.richpresence", true) { + { + addParameter("disablenotskyblock", new FeatureParameter<Boolean>("disablenotskyblock", "Disable When not on Skyblock", "Disable When not on skyblock", false, "boolean")); + } + }); + DISCORD_ASKTOJOIN = register(new PartyInviteViewer()); + DISCORD_ONLINEALARM = register(new PlayingDGAlarm()); + DISCORD_DONOTUSE = register(new SimpleFeature("Discord", "Disable Native Library", "Disables usage of jna for discord rpc support.\nBreaks any discord related feature in the mod.\nRequires mod restart to get affected.\n\nThis feature is only for those whose minecraft crashes due to discord gamesdk crash.", "discord.rpc", false)); + DEBUG = register(new FeatureDebug()); + ADVANCED_ROOMEDIT = register(new SimpleFeature("Debug", "Room Edit", "Allow editing dungeon rooms\n\nWarning: using this feature can break or freeze your Minecraft\nThis is only for advanced users only", "advanced.roomedit", false) { + { + addParameter("key", new FeatureParameter<Integer>("key", "Key", "Press to edit room", Keyboard.KEY_R, "keybind")); + } + }); + ADVANCED_DEBUG_ROOM = register(new FeatureRoomDebugInfo()); + ADVANCED_DEBUGGABLE_MAP = register(new FeatureDebuggableMap()); + ADVANCED_COORDS = register(new FeatureRoomCoordDisplay()); + ADVANCED_BAT = register(new FeatureDebugTrap()); + } catch (Exception e) { + System.out.println(e); + throw new RuntimeException(e); + } + + + for (AbstractFeature abstractFeature : featureList) { + if(abstractFeature == null){ + throw new IllegalStateException("Feature " + abstractFeature.getKey() + " is null, this cannot happen!!!"); + } + } + + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/GuiFeature.java index 9e34be02..c1d2a144 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/GuiFeature.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features; +package kr.syeyoung.dungeonsguide.mod.features; import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfigV2; -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.config.types.GUIRectangle; -import kr.syeyoung.dungeonsguide.config.types.TypeConverterRegistry; -import kr.syeyoung.dungeonsguide.features.listener.ScreenRenderListener; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.GuiConfigV2; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.config.types.GUIRectangle; +import kr.syeyoung.dungeonsguide.mod.config.types.TypeConverterRegistry; +import kr.syeyoung.dungeonsguide.mod.features.listener.ScreenRenderListener; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/SimpleFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/SimpleFeature.java index 03be804c..b8d20c5c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/SimpleFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/SimpleFeature.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features; +package kr.syeyoung.dungeonsguide.mod.features; public class SimpleFeature extends AbstractFeature { protected SimpleFeature(String category, String name, String key) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureCollectScore.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebug.java index f7e92262..486ac05b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureCollectScore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebug.java @@ -16,13 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; + +public class FeatureDebug extends SimpleFeature { + + public FeatureDebug() { + super("Debug", "Debug", "Toggles debug mode", "debug", false); -public class FeatureCollectScore extends SimpleFeature { - public FeatureCollectScore() { - super("Misc", "Collect Speed Score", "Collect Speed score, run time, and floor and send that to developer's server for speed formula. This data is completely anonymous, opt out of the feature by disabling this feature", "misc.gatherscoredata", true); } + + } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java new file mode 100644 index 00000000..92a47949 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java @@ -0,0 +1,80 @@ +package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityBat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class FeatureDebugTrap extends TextHUDFeature { + public FeatureDebugTrap() { + super("Debug", "Display the current amount of bat entities", "", "advanced.bat", false, getFontRenderer().getStringWidth("Bats: 9999"), getFontRenderer().FONT_HEIGHT); + getStyles().add(new TextStyle("base", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); + getStyles().add(new TextStyle("batsamm", new AColor(0x55, 0xFF,0xFF,255), new AColor(0, 0,0,0), false)); + } + + + + SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); + + private static final List<StyledText> dummyText= new ArrayList<>(); + static { + dummyText.add(new StyledText("Bats: ","base")); + dummyText.add(new StyledText("9999","batsamm")); + } + + + static List<Long> avgStorage = new ArrayList<>(); + + public static void updateVal(long timeItTookForThePacketToProcess){ + System.out.println(timeItTookForThePacketToProcess); + if(avgStorage.size() > 5){ + avgStorage.remove( 0); + } + + avgStorage.add(timeItTookForThePacketToProcess); + } + + + static long getAvgTimeItTookToPAcket(){ + return (long) avgStorage.stream().mapToLong(val -> val).average().orElse(0.0); + } + + @Override + public boolean isHUDViewable() { + return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getMapProcessor() != null; + } + + @Override + public List<String> getUsedTextStyle() { + return Arrays.asList("batsamm", "base"); + } + + @Override + public List<StyledText> getDummyText() { + return dummyText; + } + + @Override + public List<StyledText> getText() { + + List<Entity> bats = Minecraft.getMinecraft().theWorld.getEntities(EntityBat.class, e -> true); + + + List<StyledText> actualBit = new ArrayList<>(); + actualBit.add(new StyledText("Bats: ","base")); + + + actualBit.add(new StyledText(String.valueOf(getAvgTimeItTookToPAcket()),"batsamm")); + + return actualBit; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java index 2a2b1a39..7501561e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java @@ -16,25 +16,21 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.advanced; +package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.features.listener.GuiPostRenderListener; -import kr.syeyoung.dungeonsguide.utils.MapUtils; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.utils.MapUtils; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.fml.client.config.GuiUtils; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -44,7 +40,7 @@ import java.util.Arrays; public class FeatureDebuggableMap extends GuiFeature { public FeatureDebuggableMap() { - super("Advanced", "Display Debug Info included map", "ONLY WORKS WITH SECRET SETTING", "advanced.debug.map", true, 128, 128); + super("Debug", "Display Debug Info included map", "ONLY WORKS WITH SECRET SETTING", "advanced.debug.map", true, 128, 128); this.setEnabled(false); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java index 553cf3a5..87f41e93 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.advanced; +package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; @@ -37,17 +37,20 @@ import java.awt.*; public class FeatureRoomCoordDisplay extends GuiFeature { public FeatureRoomCoordDisplay() { - super("Advanced", "Display Coordinate Relative to the Dungeon Room and room's rotation", "X: 0 Y: 3 Z: 5 Facing: Z+" , "advanced.coords", false, getFontRenderer().getStringWidth("X: 48 Y: 100 Z: 48 Facing: Z+"), 10); + super("Debug", "Display Coordinate Relative to the Dungeon Room and room's rotation", "X: 0 Y: 3 Z: 5 Facing: Z+" , "advanced.coords", false, getFontRenderer().getStringWidth("X: 48 Y: 100 Z: 48 Facing: Z+"), 10); this.setEnabled(false); - parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.yellow, "color")); + addParameter("color", new FeatureParameter<>("color", "Color", "Color of text", Color.yellow, "color", nval -> color = nval.getRGB())); } + + int color = 0; + SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); private static final String[] facing = {"Z+", "X-", "Z-", "X+"}; @Override public void drawHUD(float partialTicks) { if (!skyblockStatus.isOnDungeon()) return; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return; EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; @@ -68,8 +71,6 @@ public class FeatureRoomCoordDisplay extends GuiFeature { double scale = getFeatureRect().getRectangle().getHeight() / fontRenderer.FONT_HEIGHT; GlStateManager.scale(scale, scale, 0); - int color = this.<Color>getParameter("color").getValue().getRGB(); - GlStateManager.enableBlend(); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java index c5dc4264..0e983e88 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomDebugInfo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.advanced; +package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; @@ -37,23 +37,24 @@ import java.awt.*; public class FeatureRoomDebugInfo extends GuiFeature { public FeatureRoomDebugInfo() { - super("Advanced", "Display Room Debug Info", "ONLY WORKS WITH SECRET SETTING", "advanced.debug.roominfo", false, getFontRenderer().getStringWidth("longestplayernamepos: 100"), getFontRenderer().FONT_HEIGHT * 6); + super("Debug", "Display Room Debug Info", "ONLY WORKS WITH SECRET SETTING", "advanced.debug.roominfo", false, getFontRenderer().getStringWidth("longestplayernamepos: 100"), getFontRenderer().FONT_HEIGHT * 6); this.setEnabled(false); - parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.white, "color")); + addParameter("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.white, "color", nval -> color = nval.getRGB())); } + int color = 0; + SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public void drawHUD(float partialTicks) { if (!skyblockStatus.isOnDungeon()) return; if (!FeatureRegistry.DEBUG.isEnabled()) return; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return; EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; - int color = this.<Color>getParameter("color").getValue().getRGB(); GlStateManager.enableBlend(); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -84,11 +85,11 @@ public class FeatureRoomDebugInfo extends GuiFeature { GlStateManager.enableBlend(); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - fr.drawString("Line 1", 0,0, this.<Color>getParameter("color").getValue().getRGB()); - fr.drawString("Line 2", 0,10, this.<Color>getParameter("color").getValue().getRGB()); - fr.drawString("Line 3", 0,20, this.<Color>getParameter("color").getValue().getRGB()); - fr.drawString("Line 4", 0,30, this.<Color>getParameter("color").getValue().getRGB()); - fr.drawString("Line 5", 0,40, this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Line 1", 0,0, color); + fr.drawString("Line 2", 0,10, color); + fr.drawString("Line 3", 0,20, color); + fr.drawString("Line 4", 0,30, color); + fr.drawString("Line 5", 0,40, color); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPepole.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPepole.java new file mode 100644 index 00000000..cc2f911a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPepole.java @@ -0,0 +1,460 @@ +package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonStartListener; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.stomp.StompManager; +import kr.syeyoung.dungeonsguide.mod.stomp.StompPayload; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.client.resources.SkinManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.json.JSONObject; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.regex.Pattern; + +import static kr.syeyoung.dungeonsguide.mod.utils.TabListUtil.getString; + +public class FeatureTestPepole extends GuiFeature implements ChatListener, DungeonStartListener { + + Logger logger = LogManager.getLogger("FeatureTestPepole"); + private Float scale; + private Set<String> lastmebersRaw; + private boolean broadcastLock; + + public FeatureTestPepole() { + super("Dungeon", "Feuture test", "NOU", "", false, 200, 100); + + + addParameter("scale", new FeatureParameter<>("scale", "Scale", "Scale", 2.0f, "float", nval -> this.scale = nval)); + MinecraftForge.EVENT_BUS.register(this); + +// (new Thread(() -> { +// while (true){ +// handleSelfBroadcasts(); +// } +// }) ).start(); + } + + public static void handlePartyBroadCast(String playload) { + String[] messagge = playload.substring(2).split(":"); + +// String random = messagge[1]; + String username = messagge[0]; + System.out.println("Broadcast was a self broadcast with: " + username); + PartyManager.INSTANCE.getPartyContext().addDgUser(username); + +// String actualPayload = "ACK" + random + ":" + username + ":" + Minecraft.getMinecraft().getSession().getUsername(); +// StompManager.getInstance().send(new StompPayload().header("destination", "/app/party.broadcast").payload( +// new JSONObject().put("partyID", PartyManager.INSTANCE.getPartyContext().getPartyID()) +// .put("payload", actualPayload).toString() +// )); + +// } else if (playload.startsWith("ACK")){ +// String ACKnick = playload.substring(3); +// String[] nicks = ACKnick.split(":"); +// if(Objects.equals(nicks[0], Minecraft.getMinecraft().getSession().getUsername())) { +// FeatureTestPepole.addACK(new Tuple<String, String>(nicks[1], nicks[2])); +// } + } + +// static List<Tuple<String, String>> acknicks = new ArrayList<>(); +// +// static List<Tuple<Integer, Long>> sentContros = new ArrayList<>(); + +// public static void addACK(Tuple<String,String> acKnick) { +// acknicks.add(acKnick); +// } + + public void broadcastYourself() { + if (PartyManager.INSTANCE.getPartyContext().getPartyID() == null) { + return; + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + logger.info("Sending self broadcast"); +// int control = (new Random()).nextInt(1000); + String actualPayload = "C:" + Minecraft.getMinecraft().getSession().getUsername() + ":" + 222; + StompManager.getInstance().send(new StompPayload().header("destination", "/app/party.broadcast").payload( + new JSONObject().put("partyID", PartyManager.INSTANCE.getPartyContext().getPartyID()) + .put("payload", actualPayload).toString() + )); +// sentContros.add(new Tuple<>(control, System.currentTimeMillis())); + broadcastLock = false; + } + + public void handleSelfBroadcasts(){ + if(broadcastLock) { + broadcastYourself(); + return; + } + + +// for (Tuple<String, String> acknick : acknicks) { +// int a = Integer.parseInt(acknick.getFirst()); +// for (Tuple<Integer, Long> sentContro : sentContros) { +// if(sentContro.getFirst() == a){ +// acknicks.remove(acknick); +// sentContros.remove(a); +// if(sentContro.getSecond() + 500 > System.currentTimeMillis()){ +// broadcastLock = true; +// broadcastYourself(); +// break; +// } +// } +// } +// +// } + + + if(PartyManager.INSTANCE.getPartyContext() == null) return; + + if(lastmebersRaw == null ) { + lastmebersRaw = PartyManager.INSTANCE.getPartyContext().getPartyRawMembers(); + return; + } + + Set<String> membersRaw = PartyManager.INSTANCE.getPartyContext().getPartyRawMembers(); + + if(!membersRaw.equals(lastmebersRaw)){ + logger.info("members changed unlocking locking broadcast"); + broadcastLock = true; + broadcastYourself(); + lastmebersRaw = membersRaw; + } + } + + + HashMap<String, ItemStack> SkullCashe = new HashMap<>(); + + + + ExecutorService executor = Executors.newFixedThreadPool(5); + + + public ItemStack getSkullByUserName(String username) { + if (SkullCashe.containsKey(username)) return SkullCashe.get(username); + ItemStack stack = new ItemStack(Items.skull, 1, 3); + + executor.submit(() -> { + EntityPlayer playerEntityByName = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(username); + if(playerEntityByName == null || playerEntityByName.getGameProfile() == null) { + stack.setTagCompound(new NBTTagCompound()); + stack.getTagCompound().setTag("SkullOwner", new NBTTagString(username)); + return; + } + + // this line should trick mineshaft to caching the player skin + // im doing this bc just setting SkullOwner downloads the skin on main thread + // thus causing a lag spike + Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = Minecraft.getMinecraft().getSkinManager().loadSkinFromCache(playerEntityByName.getGameProfile()); + + if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) { + Minecraft.getMinecraft().getSkinManager().loadSkin((MinecraftProfileTexture)map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN); + } + + + + stack.setTagCompound(new NBTTagCompound()); + stack.getTagCompound().setTag("SkullOwner", new NBTTagString(username)); + + }); + + SkullCashe.put(username, stack); + return stack; + } + + private Set<String> ready = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); + + private static final List<String> readyPhrase = Arrays.asList("r", "rdy", "ready"); + private static final List<String> negator = Arrays.asList("not ", "not", "n", "n "); + private static final Map<String, Boolean> readynessIndicator = new HashMap<>(); + + static { + readyPhrase.forEach(val -> readynessIndicator.put(val, true)); + for (String s : negator) { + readyPhrase.forEach(val -> readynessIndicator.put(s + val, false)); + } + readynessIndicator.put("dont start", false); + readynessIndicator.put("don't start", false); + readynessIndicator.put("dont go", false); + readynessIndicator.put("don't go", false); + readynessIndicator.put("start", true); + readynessIndicator.put("go", true); + } + + @Override + public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { + String txt = clientChatReceivedEvent.message.getFormattedText(); + if (!txt.startsWith("§r§9Party §8>")) return; + + String chat = TextUtils.stripColor(txt.substring(txt.indexOf(":") + 1)).trim().toLowerCase(); + + + String usernamearea = TextUtils.stripColor(txt.substring(13, txt.indexOf(":"))); + String username = null; + for (String s : usernamearea.split(" ")) { + if (s.isEmpty()) continue; + if (s.startsWith("[")) continue; + username = s; + break; + } + + Boolean status = null; + String longestMatch = ""; + for (Map.Entry<String, Boolean> stringBooleanEntry : readynessIndicator.entrySet()) { + if (chat.startsWith(stringBooleanEntry.getKey()) || chat.endsWith(stringBooleanEntry.getKey()) || (stringBooleanEntry.getKey().length() >= 3 && chat.contains(stringBooleanEntry.getKey()))) { + if (stringBooleanEntry.getKey().length() > longestMatch.length()) { + longestMatch = stringBooleanEntry.getKey(); + status = stringBooleanEntry.getValue(); + } + } + } + if (status == null) ; + else if (status) ready.add(username); + else ready.remove(username); + + } + + @Override + public void onDungeonStart() { + ready.clear(); + } + + boolean isAloneInParty() { + if (PartyManager.INSTANCE.getPartyContext() != null) { + return PartyManager.INSTANCE.getPartyContext().getPartyRawMembers().size() == 1; + } + return false; + } + + final Pattern tabListRegex = Pattern.compile("\\*[a-zA-Z0-9_]{2,16}\\*", Pattern.MULTILINE); + + /** + * We regex their name out + * @param networkPlayerInfo the network player info of player + * @return the username of player + */ + private String getPlayerNameWithChecks(NetworkPlayerInfo networkPlayerInfo) { + String name; + if (networkPlayerInfo.getDisplayName() != null) { + name = networkPlayerInfo.getDisplayName().getFormattedText(); + } else { + name = ScorePlayerTeam.formatPlayerName( + networkPlayerInfo.getPlayerTeam(), + networkPlayerInfo.getGameProfile().getName() + ); + } + + if (name.trim().equals("§r") || name.startsWith("§r ")) return null; + + name = TextUtils.stripColor(name); + + return getString(name, tabListRegex); + } + + boolean isPlayerInDungeon(String username) { + + List<NetworkPlayerInfo> list = new ArrayList<>(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); + + // 19 iterations bc we only want to scan the player part of tab list + for (int i = 1; i < 20; i++) { + if(list.size() < i) break; + NetworkPlayerInfo networkPlayerInfo = list.get(i); + + String name = getPlayerNameWithChecks(networkPlayerInfo); + if (name == null) continue; + + EntityPlayer entityplayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(name); + + + if (entityplayer != null && (!entityplayer.isInvisible())) { + if (name == username) return true; + } + + + } + return false; + } + + + public final Map<String, Boolean> cachedProfiles = new HashMap<>(); + + + void renderItem(GameProfile stack, int x, int y){ + + +// GameProfile a = new GameProfile(); + + GameProfile toDraw = cachedProfiles.get(stack.getName()) ? stack : null; + + TileEntitySkullRenderer.instance.renderSkull(x, y, -0.5F, EnumFacing.UP, 180.0F, 1, stack, -1); + + if(toDraw == null && !cachedProfiles.containsKey(stack.getName())){ + cachedProfiles.put(stack.getName(), false); + new Thread(() -> { + Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = Minecraft.getMinecraft().getSkinManager().loadSkinFromCache(stack); + + if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) { + + MinecraftProfileTexture profileTexture = map.get(MinecraftProfileTexture.Type.SKIN); + + final ResourceLocation resourceLocation = new ResourceLocation("skins/" + profileTexture.getHash()); + ITextureObject iTextureObject = Minecraft.getMinecraft().getTextureManager().getTexture(resourceLocation); + if (iTextureObject == null) { + + String skinCacheDir = ReflectionHelper.getPrivateValue(SkinManager.class, Minecraft.getMinecraft().getSkinManager(), "field_152796_d", "skinCacheDir"); + + File file = new File(skinCacheDir, profileTexture.getHash().length() > 2 ? profileTexture.getHash().substring(0, 2) : "xx"); + File file2 = new File(file, profileTexture.getHash()); + final IImageBuffer iImageBuffer = new ImageBufferDownload(); + ThreadDownloadImageData threadDownloadImageData = new ThreadDownloadImageData(file2, profileTexture.getUrl(), DefaultPlayerSkin.getDefaultSkinLegacy(), new IImageBuffer() { + + public BufferedImage parseUserSkin(BufferedImage image) { + if (iImageBuffer != null) { + image = iImageBuffer.parseUserSkin(image); + } + + return image; + } + + public void skinAvailable() { + if (iImageBuffer != null) { + iImageBuffer.skinAvailable(); + } + } + }); + Minecraft.getMinecraft().getTextureManager().loadTexture(resourceLocation, threadDownloadImageData); + } + } + + cachedProfiles.replace(stack.getName(), true); + }).start(); + } + + + + } + + @Override + public void drawHUD(float partialTicks) { + + if (PartyManager.INSTANCE.getPartyContext() == null) return; + if (!PartyManager.INSTANCE.getPartyContext().isPartyExistHypixel()) return; +// if(isAloneInParty()) return; + + ResourceLocation logoLoc = new ResourceLocation("dungeonsguide:textures/dglogox32.png"); + + FontRenderer fr = getFontRenderer(); + + + int y = 0; + for (String partyRawMember : PartyManager.INSTANCE.getPartyContext().getPartyRawMembers()) { + + boolean isDgUser = isDgUser(partyRawMember); + + int xOffset = isDgUser ? 9 : -2; + + GlStateManager.pushMatrix(); + + + GlStateManager.scale(scale, scale, 1F); + + Gui.drawRect(15 + xOffset, 5 + y, fr.getStringWidth(partyRawMember + genPlayerText(partyRawMember)) + 20 + xOffset, 15 + y, getColorTextColor(partyRawMember)); + + RenderHelper.enableStandardItemLighting(); + renderItem(Minecraft.getMinecraft().theWorld.getPlayerEntityByName(partyRawMember).getGameProfile(), 0, y + 1); +// Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(getSkullByUserName(partyRawMember), 0, y + 1); + RenderHelper.disableStandardItemLighting(); + + fr.drawString(partyRawMember, 15 + xOffset, y + 5, 0xffffff); + + + fr.drawString(genPlayerText(partyRawMember), 16 + fr.getStringWidth(partyRawMember) + xOffset, y + 5, 0xf9f9fa); + + if (isDgUser) { + + GlStateManager.translate(xOffset + 5, y + 3.5F, 200F); + GlStateManager.scale(0.32F, 0.32F, 1F); + Minecraft.getMinecraft().getTextureManager().bindTexture(logoLoc); + Gui.drawModalRectWithCustomSizedTexture(0, 0, 0, 0, 32, 32, 32, 32); + } + + + GlStateManager.popMatrix(); + + y += 12; + } + + } + + private boolean isDgUser(String partyRawMember) { + if (Objects.equals(partyRawMember, Minecraft.getMinecraft().getSession().getUsername())) return true; + return PartyManager.INSTANCE.getPartyContext().isDgUser(partyRawMember); + } + + + private int getColorTextColor(String partyRawMember) { + if (Objects.equals(genPlayerText(partyRawMember), ": Ready") || Objects.equals(genPlayerText(partyRawMember), ": Not Ready")) { + boolean isPlayerReady = ready.contains(partyRawMember); + return isPlayerReady ? 0xFF12bc00 : 0xFFd70022; + } + + + return 0xFF38383d; + } + + + String genPlayerText(String username) { + + if (DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) { + if (Objects.equals(username, Minecraft.getMinecraft().getSession().getUsername())) { + return ": In Dungeon"; + } else if (isPlayerInDungeon(username)) { + return ": In Dungeon"; + } else { + return ": Somewhere"; + } + } else { + if (ready.contains(username)) { + return ": Ready"; + } + + return ": Not Ready"; + } + } + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureAutoReparty.java index ad6b7200..8ac55d88 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureAutoReparty.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.DungeonQuitListener; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonQuitListener; public class FeatureAutoReparty extends SimpleFeature implements DungeonQuitListener { public FeatureAutoReparty() { - super("Party.Reparty", "Auto reparty when dungeon finishes","Auto reparty on dungeon finish\n\nThis automates player chatting action, (disbanding, repartying) Thus it might be against hypixel's rules.\nBut mods like auto-gg exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "bossfight.autoreparty", false); + super("Party.Reparty", "Auto reparty when dungeon finishes","Auto reparty on dungeon finish\n\nThis automates player chatting action, (disbanding, repartying) Thus it might be against hypixel's rules.\nBut mods like auto-gg exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "party.autoreparty", false); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java index f8cd2257..02ec1a87 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.HealthData; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.HealthData; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.util.ArrayList; import java.util.Arrays; @@ -34,11 +34,11 @@ import java.util.List; public class FeatureBossHealth extends TextHUDFeature { public FeatureBossHealth() { - super("Bossfight", "Display Boss Health(s)", "Show the health of boss and minibosses in bossfight (Guardians, Priests..)", "bossfight.health", false, getFontRenderer().getStringWidth("The Professor: 4242m"), getFontRenderer().FONT_HEIGHT * 5); + super("Dungeon.Bossfight", "Display Boss(es) Health", "Show the health of boss and minibosses in bossfight (Guardians, Priests..)", "bossfight.health", false, getFontRenderer().getStringWidth("The Professor: 4242m"), getFontRenderer().FONT_HEIGHT * 5); this.setEnabled(true); - parameters.put("totalHealth", new FeatureParameter<Boolean>("totalHealth", "show total health", "Show total health along with current health", false, "boolean")); - parameters.put("formatHealth", new FeatureParameter<Boolean>("formatHealth", "format health", "1234568 -> 1m", true, "boolean")); - parameters.put("ignoreInattackable", new FeatureParameter<Boolean>("ignoreInattackable", "Don't show health of in-attackable enemy", "For example, do not show guardians health when they're not attackable", false, "boolean")); + addParameter("totalHealth", new FeatureParameter<Boolean>("totalHealth", "show total health", "Show total health along with current health", false, "boolean", nval -> totalHealth = nval)); + addParameter("formatHealth", new FeatureParameter<Boolean>("formatHealth", "format health", "1234568 -> 1m", true, "boolean", nval -> formatHealth = nval)); + addParameter("ignoreInattackable", new FeatureParameter<Boolean>("ignoreInattackable", "Don't show health of in-attackable enemy", "For example, do not show guardians health when they're not attackable", false, "boolean", nval -> ignoreInattackable = nval)); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -47,7 +47,11 @@ public class FeatureBossHealth extends TextHUDFeature { getStyles().add(new TextStyle("maxHealth", new AColor(0x55, 0x55,0xFF,255), new AColor(0, 0,0,0), false)); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); + + boolean totalHealth; + boolean formatHealth; + boolean ignoreInattackable; + @Override @@ -57,7 +61,7 @@ public class FeatureBossHealth extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() != null; + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() != null; } @Override @@ -77,24 +81,21 @@ public class FeatureBossHealth extends TextHUDFeature { } public void addLine(HealthData data, List<StyledText> actualBit) { - boolean format = this.<Boolean>getParameter("formatHealth").getValue(); - boolean total = this.<Boolean>getParameter("totalHealth").getValue(); - boolean ignore = this.<Boolean>getParameter("ignoreInattackable").getValue(); - if (ignore && !data.isAttackable()) return; + if (ignoreInattackable && !data.isAttackable()) return; actualBit.add(new StyledText(data.getName(),"title")); actualBit.add(new StyledText(": ","separator")); - actualBit.add(new StyledText( (format ? TextUtils.format(data.getHealth()) : data.getHealth()) + (total ? "" : "\n"),"health")); - if (total) { + actualBit.add(new StyledText( (formatHealth ? TextUtils.format(data.getHealth()) : data.getHealth()) + (totalHealth ? "" : "\n"),"health")); + if (totalHealth) { actualBit.add(new StyledText("/", "separator2")); - actualBit.add(new StyledText( (format ? TextUtils.format(data.getMaxHealth()) : data.getMaxHealth()) +"\n","maxHealth")); + actualBit.add(new StyledText( (formatHealth ? TextUtils.format(data.getMaxHealth()) : data.getMaxHealth()) +"\n","maxHealth")); } } @Override public java.util.List<StyledText> getText() { List<StyledText> actualBit = new ArrayList<StyledText>(); - List<HealthData> healths = skyblockStatus.getContext().getBossfightProcessor().getHealths(); + List<HealthData> healths = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor().getHealths(); for (HealthData heal : healths) { addLine(heal, actualBit); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java index 415753b5..18be868c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java @@ -16,39 +16,39 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorLivid; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorLivid; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.entity.EntityOtherPlayerMP; import net.minecraft.util.AxisAlignedBB; public class FeatureBoxRealLivid extends SimpleFeature implements WorldRenderListener { public FeatureBoxRealLivid() { - super("Bossfight.Floor 5", "Box Real Livid", "Box Real Livid in bossfight", "bossfight.realLividBox", true); - parameters.put("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Livid", new AColor(0,255,0,150), "acolor")); + super("Dungeon.Bossfight.Floor 5", "Box Real Livid", "Box Real Livid in bossfight", "Dungeon.Bossfight.realLividBox", true); + addParameter("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Livid", new AColor(0,255,0,150), "acolor", nval -> color = nval)); } + AColor color = null; private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public void drawWorld(float partialTicks) { if (!isEnabled()) return; if (!skyblockStatus.isOnDungeon()) return; - if (skyblockStatus.getContext() == null) return; - if (skyblockStatus.getContext().getBossfightProcessor() == null) return; - if (!(skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorLivid)) return; - EntityOtherPlayerMP playerMP = ((BossfightProcessorLivid) skyblockStatus.getContext().getBossfightProcessor()).getRealLivid(); + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null) return; + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() == null) return; + if (!(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorLivid)) return; + EntityOtherPlayerMP playerMP = ((BossfightProcessorLivid) DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor()).getRealLivid(); - AColor c = this.<AColor>getParameter("color").getValue(); if (playerMP != null) - RenderUtils.highlightBox(playerMP, AxisAlignedBB.fromBounds(-0.4,0,-0.4,0.4,1.8,0.4), c, partialTicks, true); + RenderUtils.highlightBox(playerMP, AxisAlignedBB.fromBounds(-0.4,0,-0.4,0.4,1.8,0.4), color, partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java index 6d4f9cf3..ba5043fe 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureChestPrice.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.GuiBackgroundRenderListener; -import kr.syeyoung.dungeonsguide.utils.AhUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiBackgroundRenderListener; +import kr.syeyoung.dungeonsguide.mod.utils.AhUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -43,7 +43,7 @@ import java.util.TreeSet; public class FeatureChestPrice extends SimpleFeature implements GuiBackgroundRenderListener { public FeatureChestPrice() { - super("Bossfight", "Show Profit of Dungeon Chests","Show Profit of Dungeon Chests", "bossfight.profitchest", false); + super("Dungeon", "Show Profit of Dungeon Reward Chests","Show Profit of Dungeon Chests", "bossfight.profitchest", false); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java index 502229fe..f1a32868 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import java.util.ArrayList; import java.util.Arrays; @@ -31,7 +31,7 @@ import java.util.List; public class FeatureCurrentPhase extends TextHUDFeature { public FeatureCurrentPhase() { - super("Bossfight", "Display Current Phase", "Displays the current phase of bossfight", "bossfight.phasedisplay", false, getFontRenderer().getStringWidth("Current Phase: fight-2-idk-howlng"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Bossfight", "Display Current Phase", "Displays the current phase of bossfight", "bossfight.phasedisplay", false, getFontRenderer().getStringWidth("Current Phase: fight-2-idk-howlng"), getFontRenderer().FONT_HEIGHT); this.setEnabled(true); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -48,7 +48,7 @@ public class FeatureCurrentPhase extends TextHUDFeature { } @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() != null; + return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() != null; } @Override @@ -63,7 +63,7 @@ public class FeatureCurrentPhase extends TextHUDFeature { @Override public List<StyledText> getText() { - String currentPhsae =skyblockStatus.getContext().getBossfightProcessor().getCurrentPhase(); + String currentPhsae = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor().getCurrentPhase(); List<StyledText> actualBit = new ArrayList<StyledText>(); actualBit.add(new StyledText("Current Phase","title")); actualBit.add(new StyledText(": ","separator")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java index 6330f5bb..d946ae39 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java @@ -16,28 +16,35 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.EntityLivingRenderListener; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorThorn; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.EntityLivingRenderListener; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorThorn; import net.minecraft.entity.passive.*; import net.minecraftforge.client.event.RenderLivingEvent; public class FeatureHideAnimals extends SimpleFeature implements EntityLivingRenderListener { public FeatureHideAnimals() { - super("Bossfight.Floor 4", "Hide animals on f4", "Hide Spirit Animals on F4. \nClick on Edit for precise setting", "bossfight.hideanimals", false); - parameters.put("sheep", new FeatureParameter<Boolean>("sheep", "Hide Sheeps", "Hide Sheeps", true, "boolean")); - parameters.put("cow", new FeatureParameter<Boolean>("cow", "Hide Cows", "Hide Cows", true, "boolean")); - parameters.put("chicken", new FeatureParameter<Boolean>("chicken", "Hide Chickens", "Hide Chickens", true, "boolean")); - parameters.put("wolf", new FeatureParameter<Boolean>("wolf", "Hide Wolves", "Hide Wolves", true, "boolean")); - parameters.put("rabbit", new FeatureParameter<Boolean>("rabbit", "Hide Rabbits", "Hide Rabbits", true, "boolean")); + super("Dungeon.Bossfight.Floor 4", "Hide animals on f4", "Hide Spirit Animals on F4. \nClick on Edit for precise setting", "bossfight.hideanimals", false); + addParameter("sheep", new FeatureParameter<Boolean>("sheep", "Hide Sheeps", "Hide Sheeps", true, "boolean", nval -> sheep = nval)); + addParameter("cow", new FeatureParameter<Boolean>("cow", "Hide Cows", "Hide Cows", true, "boolean", nval -> cow = nval)); + addParameter("chicken", new FeatureParameter<Boolean>("chicken", "Hide Chickens", "Hide Chickens", true, "boolean", nval -> chicken = nval)); + addParameter("wolf", new FeatureParameter<Boolean>("wolf", "Hide Wolves", "Hide Wolves", true, "boolean", nval -> wolf = nval)); + addParameter("rabbit", new FeatureParameter<Boolean>("rabbit", "Hide Rabbits", "Hide Rabbits", true, "boolean", nval -> rabbit = nval)); } + boolean sheep; + boolean cow; + boolean chicken; + boolean wolf; + boolean rabbit; + + private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @@ -45,19 +52,19 @@ public class FeatureHideAnimals extends SimpleFeature implements EntityLivingRen public void onEntityRenderPre(RenderLivingEvent.Pre renderPlayerEvent) { if (!isEnabled()) return; if (!skyblockStatus.isOnDungeon()) return; - if (skyblockStatus.getContext() == null) return; - if (skyblockStatus.getContext().getBossfightProcessor() == null) return; - if (!(skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null) return; + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() == null) return; + if (!(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; - if (renderPlayerEvent.entity instanceof EntitySheep && this.<Boolean>getParameter("sheep").getValue()) { + if (renderPlayerEvent.entity instanceof EntitySheep && sheep) { renderPlayerEvent.setCanceled(true); - } else if (renderPlayerEvent.entity instanceof EntityCow && this.<Boolean>getParameter("cow").getValue() ) { + } else if (renderPlayerEvent.entity instanceof EntityCow && cow ) { renderPlayerEvent.setCanceled(true); - } else if (renderPlayerEvent.entity instanceof EntityChicken && this.<Boolean>getParameter("chicken").getValue()) { + } else if (renderPlayerEvent.entity instanceof EntityChicken && chicken) { renderPlayerEvent.setCanceled(true); - } else if (renderPlayerEvent.entity instanceof EntityWolf && this.<Boolean>getParameter("wolf").getValue()) { + } else if (renderPlayerEvent.entity instanceof EntityWolf && wolf) { renderPlayerEvent.setCanceled(true); - } else if (renderPlayerEvent.entity instanceof EntityRabbit && this.<Boolean>getParameter("rabbit").getValue()) { + } else if (renderPlayerEvent.entity instanceof EntityRabbit && rabbit) { renderPlayerEvent.setCanceled(true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java index 22538cca..a1e849df 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorSadan; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorSadan; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.entity.boss.BossStatus; import java.util.ArrayList; @@ -34,7 +34,7 @@ import java.util.List; public class FeatureTerracotaTimer extends TextHUDFeature { public FeatureTerracotaTimer() { - super("Bossfight.Floor 6", "Display Terracotta phase timer", "Displays Terracotta phase timer", "bossfight.terracota", true, getFontRenderer().getStringWidth("Terracottas: 1m 99s"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Bossfight.Floor 6", "Display Terracotta phase timer", "Displays Terracotta phase timer", "bossfight.terracota", true, getFontRenderer().getStringWidth("Terracottas: 1m 99s"), getFontRenderer().FONT_HEIGHT); this.setEnabled(true); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -51,8 +51,8 @@ public class FeatureTerracotaTimer extends TextHUDFeature { } @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorSadan && - "fight-1".equalsIgnoreCase(skyblockStatus.getContext().getBossfightProcessor().getCurrentPhase()); + return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorSadan && + "fight-1".equalsIgnoreCase(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor().getCurrentPhase()); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java index 542beb6e..6eac5186 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorThorn; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorThorn; import java.util.ArrayList; import java.util.Arrays; @@ -32,7 +32,7 @@ import java.util.List; public class FeatureThornBearPercentage extends TextHUDFeature { public FeatureThornBearPercentage() { - super("Bossfight.Floor 4", "Display Spirit Bear Summon Percentage", "Displays spirit bear summon percentage in hud", "bossfight.spiritbear", true, getFontRenderer().getStringWidth("Spirit Bear: 100%"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Bossfight.Floor 4", "Display Spirit Bear Summon Percentage", "Displays spirit bear summon percentage in hud", "bossfight.spiritbear", true, getFontRenderer().getStringWidth("Spirit Bear: 100%"), getFontRenderer().FONT_HEIGHT); this.setEnabled(true); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -51,7 +51,7 @@ public class FeatureThornBearPercentage extends TextHUDFeature { } @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn; + return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn; } @Override @@ -66,7 +66,7 @@ public class FeatureThornBearPercentage extends TextHUDFeature { @Override public java.util.List<StyledText> getText() { - int percentage = (int) (((BossfightProcessorThorn) skyblockStatus.getContext().getBossfightProcessor()).calculatePercentage() * 100); + int percentage = (int) (((BossfightProcessorThorn) DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor()).calculatePercentage() * 100); List<StyledText> actualBit = new ArrayList<StyledText>(); actualBit.add(new StyledText("Spirit Bear","title")); actualBit.add(new StyledText(": ","separator")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java index 094600cb..208aef73 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java @@ -16,19 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.TickListener; -import kr.syeyoung.dungeonsguide.features.listener.TitleListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorThorn; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.TitleListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorThorn; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.network.play.server.S45PacketTitle; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -38,7 +37,7 @@ import java.util.List; public class FeatureThornSpiritBowTimer extends TextHUDFeature implements ChatListener, TitleListener { public FeatureThornSpiritBowTimer() { - super("Bossfight.Floor 4", "Display Spirit bow timer", "Displays how long until spirit bow gets destroyed", "bossfight.spiritbowdisplay", false, getFontRenderer().getStringWidth("Spirit Bow Destruction: 2m 00s"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Bossfight.Floor 4", "Display Spirit bow timer", "Displays how long until spirit bow gets destroyed", "bossfight.spiritbowdisplay", false, getFontRenderer().getStringWidth("Spirit Bow Destruction: 2m 00s"), getFontRenderer().FONT_HEIGHT); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("time", new AColor(0x55, 0xFF,0xFF,255), new AColor(0, 0,0,0), false)); @@ -54,7 +53,7 @@ public class FeatureThornSpiritBowTimer extends TextHUDFeature implements ChatLi } @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn && time > System.currentTimeMillis(); + return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn && time > System.currentTimeMillis(); } @Override @@ -79,7 +78,7 @@ public class FeatureThornSpiritBowTimer extends TextHUDFeature implements ChatLi @Override public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { - if (!(skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; + if (!(skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; String text = clientChatReceivedEvent.message.getFormattedText(); if (text.equals("§r§a§lThe §r§5§lSpirit Bow §r§a§lhas dropped!§r")) { time = System.currentTimeMillis() + 16000; @@ -103,7 +102,7 @@ public class FeatureThornSpiritBowTimer extends TextHUDFeature implements ChatLi @Override public void onTitle(S45PacketTitle renderPlayerEvent) { - if (!(skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; + if (!(skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; if (renderPlayerEvent.getMessage().getFormattedText().contains("picked up")) { time = System.currentTimeMillis() + 21000; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java index 1ee76e91..2d5eb2d2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java @@ -16,32 +16,32 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss; import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.impl.dungeon.FeatureDungeonScore; -import kr.syeyoung.dungeonsguide.features.text.*; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.impl.dungeon.FeatureDungeonScore; +import kr.syeyoung.dungeonsguide.mod.features.text.*; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.util.*; public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextProvider { public FeatureWarningOnPortal() { super("Dungeon.Blood Room", "Score Warning on Watcher portal", "Display warnings such as\n- 'NOT ALL ROOMS DISCOVERED'\n- 'NOT ALL ROOMS COMPLETED'\n- 'Expected Score: 304'\n- 'MISSING 3 CRYPTS'\non portal", "bossfight.warningonportal"); - this.parameters.put("textStyles", new FeatureParameter<List<TextStyle>>("textStyles", "", "", new ArrayList<TextStyle>(), "list_textStyle")); + addParameter("textStyles", new FeatureParameter<List<TextStyle>>("textStyles", "", "", new ArrayList<TextStyle>(), "list_textStyle")); getStyles().add(new TextStyle("warning", new AColor(255, 0,0,255), new AColor(255, 255,255,255), false)); getStyles().add(new TextStyle("field_name", new AColor(255, 72,255,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("field_separator", new AColor(204, 204,204,255), new AColor(0, 0,0,0), false)); @@ -103,7 +103,7 @@ public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextP @Override public List<StyledText> getText() { ArrayList<StyledText> texts = new ArrayList<StyledText>(); - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); FeatureDungeonScore.ScoreCalculation scoreCalculation = FeatureRegistry.DUNGEON_SCORE.calculateScore(); boolean failed = context.getDungeonRoomList().stream().anyMatch(a -> a.getCurrentState() == DungeonRoom.RoomState.FAILED); @@ -149,7 +149,7 @@ public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextP texts.add(new StyledText("Explorer","field_name")); texts.add(new StyledText(": ","field_separator")); texts.add(new StyledText(scoreCalculation.getExplorer()+" ","field_value")); - texts.add(new StyledText("("+FeatureRegistry.DUNGEON_SCORE.getPercentage()+"% + secrets)\n","field_etc")); + texts.add(new StyledText("("+ DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getPercentage() +"% + secrets)\n","field_etc")); texts.add(new StyledText("Time","field_name")); texts.add(new StyledText(": ","field_separator")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/CorrectThePaneSolutionProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/CorrectThePaneSolutionProvider.java index 5c4106c6..de0fff4f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/CorrectThePaneSolutionProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/CorrectThePaneSolutionProvider.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; import net.minecraft.init.Blocks; import net.minecraft.inventory.ContainerChest; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java index a13eafc2..3bb66763 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.InteractListener; -import kr.syeyoung.dungeonsguide.features.listener.TickListener; -import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; -import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorNecron; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.InteractListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.TickListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.bossfight.BossfightProcessorNecron; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; @@ -40,7 +40,7 @@ import java.util.List; public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRenderListener, TickListener, InteractListener { public FeatureSimonSaysSolver() { - super("Solver.Floor 7+.Bossfight","Simon Says Solver","Solver for Simon says puzzle", "bossfight.simonsays2"); + super("Dungeon.Bossfight.Floor 7+","Simon Says Solver","Solver for Simon says puzzle", "Dungeon.Bossfight.simonsays2"); } private final SkyblockStatus ss = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @@ -50,7 +50,7 @@ public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRender @Override public void drawWorld(float partialTicks) { if (!isEnabled()) return; - DungeonContext dc = ss.getContext(); + DungeonContext dc = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (dc == null) { return; } @@ -66,20 +66,18 @@ public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRender private boolean wasButton = false; @Override public void onTick() { - DungeonContext dc = ss.getContext(); + DungeonContext dc = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (dc == null) { wasButton = false; return; } if (!(dc.getBossfightProcessor() instanceof BossfightProcessorNecron)) return; - World w = dc.getWorld(); - - if (wasButton && w.getBlockState(new BlockPos(309, 123, 291)).getBlock() == Blocks.air) { + if (wasButton && DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(new BlockPos(309, 123, 291)).getBlock() == Blocks.air) { orderclick.clear(); orderbuild.clear(); wasButton = false; - } else if (!wasButton && w.getBlockState(new BlockPos(309, 123, 291)).getBlock() == Blocks.stone_button){ + } else if (!wasButton && DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(new BlockPos(309, 123, 291)).getBlock() == Blocks.stone_button){ orderclick.addAll(orderbuild); wasButton = true; } @@ -87,7 +85,7 @@ public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRender if (!wasButton) { for (BlockPos allInBox : BlockPos.getAllInBox(new BlockPos(310, 123, 291), new BlockPos(310, 120, 294))) { - if (w.getBlockState(allInBox).getBlock() == Blocks.sea_lantern && !orderbuild.contains(allInBox)) { + if (DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(allInBox).getBlock() == Blocks.sea_lantern && !orderbuild.contains(allInBox)) { orderbuild.add(allInBox); } } @@ -98,7 +96,7 @@ public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRender public void onInteract(PlayerInteractEvent event) { if (!isEnabled()) return; - DungeonContext dc = ss.getContext(); + DungeonContext dc = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (dc == null) return; if (!(dc.getBossfightProcessor() instanceof BossfightProcessorNecron)) return; if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) return; @@ -106,7 +104,7 @@ public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRender BlockPos pos = event.pos.add(1,0,0); if (120 <= pos.getY() && pos.getY() <= 123 && pos.getX() == 310 && 291 <= pos.getZ() && pos.getZ() <= 294) { - if (w.getBlockState(event.pos).getBlock() != Blocks.stone_button) return; + if (DungeonsGuide.getDungeonsGuide().getBlockCache().getBlockState(event.pos).getBlock() != Blocks.stone_button) return; if (pos.equals(orderclick.peek())) { orderclick.poll(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java index 749f1e2a..0b24dfce 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureTerminalSolvers.java @@ -16,14 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.*; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.*; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.ContainerChest; @@ -38,7 +36,7 @@ import java.util.List; public class FeatureTerminalSolvers extends SimpleFeature implements GuiOpenListener, TickListener, GuiPostRenderListener, GuiClickListener, TooltipListener { public FeatureTerminalSolvers() { - super("Solver.Floor 7+.Bossfight","F7 GUI Terminal Solver", "Solve f7 gui terminals. (color, startswith, order, navigate, correct panes)", "bossfight.terminals"); + super("Dungeon.Bossfight.Floor 7+","F7 GUI Terminal Solver", "Solve f7 gui terminals. (color, startswith, order, navigate, correct panes)", "bossfight.terminals"); } public static final List<TerminalSolutionProvider> solutionProviders = new ArrayList<TerminalSolutionProvider>(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/NavigateMazeSolutionProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/NavigateMazeSolutionProvider.java index f46442d6..62fc7e19 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/NavigateMazeSolutionProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/NavigateMazeSolutionProvider.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; import net.minecraft.init.Blocks; import net.minecraft.inventory.ContainerChest; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/SelectAllColorSolutionProivider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/SelectAllColorSolutionProivider.java index 230383fe..379d5179 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/SelectAllColorSolutionProivider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/SelectAllColorSolutionProivider.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/SelectInOrderSolutionProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/SelectInOrderSolutionProvider.java index b04a7726..03eab5ef 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/SelectInOrderSolutionProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/SelectInOrderSolutionProvider.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; import net.minecraft.init.Blocks; import net.minecraft.inventory.ContainerChest; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/TerminalSolution.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/TerminalSolution.java index e8b0c9a4..3d76aa44 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/TerminalSolution.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/TerminalSolution.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; import lombok.Data; import net.minecraft.inventory.Slot; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/TerminalSolutionProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/TerminalSolutionProvider.java index 4c7b3d02..e2534d16 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/TerminalSolutionProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/TerminalSolutionProvider.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/WhatStartsWithSolutionProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/WhatStartsWithSolutionProvider.java index 758360fe..889f34c0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/WhatStartsWithSolutionProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/WhatStartsWithSolutionProvider.java @@ -16,12 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.boss.terminal; +package kr.syeyoung.dungeonsguide.mod.features.impl.boss.terminal; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; -import org.apache.logging.log4j.core.appender.db.jpa.converter.ThrowableAttributeConverter; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/FeatureNicknameColor.java index 89d80ca5..ce4599f5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/FeatureNicknameColor.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.cosmetics; +package kr.syeyoung.dungeonsguide.mod.features.impl.cosmetics; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureNicknameColor extends SimpleFeature { public FeatureNicknameColor() { super("Cosmetics", "Nickname Color", "Click on Edit to choose nickname color cosmetic", "cosmetic.nickname"); - this.parameters.put("dummy", new FeatureParameter("dummy", "dummy", "dummy", "dummy", "string")); + addParameter("dummy", new FeatureParameter("dummy", "dummy", "dummy", "dummy", "string")); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/FeatureNicknamePrefix.java index 78a9c1c8..698eabb9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/FeatureNicknamePrefix.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.cosmetics; +package kr.syeyoung.dungeonsguide.mod.features.impl.cosmetics; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureNicknamePrefix extends SimpleFeature { public FeatureNicknamePrefix() { super("Cosmetics", "Nickname Prefix", "Click on Edit to choose prefix cosmetic", "cosmetic.prefix"); - this.parameters.put("dummy", new FeatureParameter("dummy", "dummy", "dummy", "dummy", "string")); + addParameter("dummy", new FeatureParameter("dummy", "dummy", "dummy", "dummy", "string")); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/PrefixSelectorGUI.java index 4750831e..6cbcfe15 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/cosmetics/PrefixSelectorGUI.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.cosmetics; +package kr.syeyoung.dungeonsguide.mod.features.impl.cosmetics; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticsManager; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/ImageTexture.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/ImageTexture.java index 62ee2913..3a4c226a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/ImageTexture.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/ImageTexture.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer; +package kr.syeyoung.dungeonsguide.mod.features.impl.discord.inviteViewer; import lombok.Data; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; @@ -39,7 +38,6 @@ import java.awt.*; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.HttpURLConnection; -import java.net.MalformedURLException; import java.net.URL; import java.util.Iterator; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyInviteViewer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/PartyInviteViewer.java index 551659d2..e73c2d52 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyInviteViewer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/PartyInviteViewer.java @@ -16,31 +16,25 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.events.DiscordUserJoinRequestEvent; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.*; -import kr.syeyoung.dungeonsguide.rpc.RichPresenceManager; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityJoinRequestReply; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.discord.inviteViewer; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.events.impl.DiscordUserJoinRequestEvent; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.*; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.RichPresenceManager; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityJoinRequestReply; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.texture.TextureManager; import net.minecraftforge.client.event.GuiScreenEvent; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.*; import java.util.List; import java.util.concurrent.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/PartyJoinRequest.java index de025698..a50966dc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/inviteViewer/PartyJoinRequest.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer; +package kr.syeyoung.dungeonsguide.mod.features.impl.discord.inviteViewer; -import kr.syeyoung.dungeonsguide.gamesdk.GameSDK; -import kr.syeyoung.dungeonsguide.gamesdk.jna.datastruct.DiscordUser; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.GameSDK; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.datastruct.DiscordUser; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/invteTooltip/MTooltipInvite.java index 253d0256..81331686 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/invteTooltip/MTooltipInvite.java @@ -16,20 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.discord.invteTooltip; +package kr.syeyoung.dungeonsguide.mod.features.impl.discord.invteTooltip; import com.sun.jna.Pointer; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordRelationshipType; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordActivityManager; -import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordCore; -import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.rpc.JDiscordRelation; -import kr.syeyoung.dungeonsguide.rpc.RichPresenceManager; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import net.minecraft.client.gui.Gui; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordActivityActionType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordRelationshipType; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct.IDiscordActivityManager; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.interfacestruct.IDiscordCore; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.typedef.DiscordSnowflake; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.JDiscordRelation; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.RichPresenceManager; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.renderer.GlStateManager; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/invteTooltip/MTooltipInviteElement.java index 4445f5a6..f29dff4b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/invteTooltip/MTooltipInviteElement.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.discord.invteTooltip; +package kr.syeyoung.dungeonsguide.mod.features.impl.discord.invteTooltip; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer.ImageTexture; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.rpc.JDiscordRelation; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.impl.discord.inviteViewer.ImageTexture; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.JDiscordRelation; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/onlinealarm/PlayingDGAlarm.java index 95eed5a2..b37aa62d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/discord/onlinealarm/PlayingDGAlarm.java @@ -16,20 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.discord.onlinealarm; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.events.DiscordUserUpdateEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer.ImageTexture; -import kr.syeyoung.dungeonsguide.features.listener.DiscordUserUpdateListener; -import kr.syeyoung.dungeonsguide.features.listener.ScreenRenderListener; -import kr.syeyoung.dungeonsguide.features.listener.TickListener; -import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordRelationshipType; -import kr.syeyoung.dungeonsguide.rpc.JDiscordActivity; -import kr.syeyoung.dungeonsguide.rpc.JDiscordRelation; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.discord.onlinealarm; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.events.impl.DiscordUserUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.impl.discord.inviteViewer.ImageTexture; +import kr.syeyoung.dungeonsguide.mod.features.listener.DiscordUserUpdateListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.ScreenRenderListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.TickListener; +import kr.syeyoung.dungeonsguide.mod.discord.gamesdk.jna.enumuration.EDiscordRelationshipType; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.JDiscordActivity; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.JDiscordRelation; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.client.Minecraft; @@ -37,7 +37,6 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.texture.TextureManager; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java index 5fac96b9..6c76b668 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.entity.passive.EntityBat; import net.minecraft.util.BlockPos; @@ -37,8 +37,8 @@ import java.util.List; public class FeatureBoxBats extends SimpleFeature implements WorldRenderListener { public FeatureBoxBats() { super("Dungeon.Mobs", "Box Bats", "Box bats in dungeons\nDoes not appear through walls", "dungeon.batbox", true); - parameters.put("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and bats to be boxed", 20, "integer")); - parameters.put("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Bats", new AColor(255,0,0,50), "acolor")); + addParameter("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and bats to be boxed", 20, "integer")); + addParameter("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Bats", new AColor(255,0,0,50), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java index 7e8c736b..4b7923d7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.util.BlockPos; @@ -37,8 +37,8 @@ import java.util.List; public class FeatureBoxSkelemaster extends SimpleFeature implements WorldRenderListener { public FeatureBoxSkelemaster() { super("Dungeon.Mobs", "Box Skeleton Masters", "Box skeleton masters in dungeons", "dungeon.skeletonmasterbox", true); - parameters.put("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and skeletonmaster to be boxed", 20, "integer")); - parameters.put("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Skeleton master", new AColor(255,0,0,50), "acolor")); + addParameter("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and skeletonmaster to be boxed", 20, "integer")); + addParameter("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Skeleton master", new AColor(255,0,0,50), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java index e41e9f69..3407e57a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; import com.google.common.base.Predicate; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.util.BlockPos; @@ -37,8 +37,8 @@ import java.util.List; public class FeatureBoxStarMobs extends SimpleFeature implements WorldRenderListener { public FeatureBoxStarMobs() { super("Dungeon.Mobs", "Box Starred mobs", "Box Starred mobs in dungeons", "dungeon.starmobbox", false); - parameters.put("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and starred mobs to be boxed", 20, "integer")); - parameters.put("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Starred mobs", new AColor(0,255,255,50), "acolor")); + addParameter("radius", new FeatureParameter<Integer>("radius", "Highlight Radius", "The maximum distance between player and starred mobs to be boxed", 20, "integer")); + addParameter("color", new FeatureParameter<AColor>("color", "Highlight Color", "Highlight Color of Starred mobs", new AColor(0,255,255,50), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureCollectScore.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureCollectScore.java new file mode 100644 index 00000000..f9ea3a49 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureCollectScore.java @@ -0,0 +1,77 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.stomp.StompManager; +import kr.syeyoung.dungeonsguide.mod.stomp.StompPayload; +import kr.syeyoung.dungeonsguide.mod.utils.MapUtils; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; +import net.minecraft.util.ChatComponentText; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.json.JSONObject; + +import java.util.concurrent.ExecutionException; + +public class FeatureCollectScore extends SimpleFeature { + Logger logger = LogManager.getLogger("FeatureCollectScore"); + public FeatureCollectScore() { + super("Misc", "Collect Speed Score", "Collect Speed score, run time, and floor and send that to developer's server for speed formula. This data is completely anonymous, opt out of the feature by disabling this feature", "misc.gatherscoredata", true); + } + + public void collectDungeonRunData(byte[] mapData, DungeonContext context) { + int skill = MapUtils.readNumber(mapData, 51, 35, 9); + int exp = MapUtils.readNumber(mapData, 51, 54, 9); + int time = MapUtils.readNumber(mapData, 51, 73, 9); + int bonus = MapUtils.readNumber(mapData, 51, 92, 9); + ChatTransmitter.sendDebugChat(new ChatComponentText(("skill: " + skill + " / exp: " + exp + " / time: " + time + " / bonus : " + bonus))); + JSONObject payload = new JSONObject().put("timeSB", FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed()) + .put("timeR", FeatureRegistry.DUNGEON_REALTIME.getTimeElapsed()) + .put("timeScore", time) + .put("completionStage", context.getBossRoomEnterSeconds() == -1 ? 0 : + context.isDefeated() ? 2 : 1) + .put("percentage", DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getPercentage() / 100.0) + .put("floor", DungeonContext.getDungeonName()); + ChatTransmitter.sendDebugChat(new ChatComponentText(payload.toString())); + + if(!StompManager.getInstance().isStompConnected()){ + logger.warn("Error stomp is not connected while trying to send dungeons scored"); + return; + } + + String target = null; + try { + target = StaticResourceCache.INSTANCE.getResource(StaticResourceCache.DATA_COLLECTION).get().getValue(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + + if (FeatureRegistry.ETC_COLLECT_SCORE.isEnabled() && !target.contains("falsefalsefalsefalse")) { + StompManager.getInstance().send(new StompPayload().payload(payload.toString()).destination(target.replace("false", "").trim())); + } + } + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java index cf1ebc08..0e9254dd 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; - -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.util.ArrayList; @@ -33,7 +33,7 @@ import java.util.List; public class FeatureDungeonCurrentRoomSecrets extends TextHUDFeature implements ChatListener { public FeatureDungeonCurrentRoomSecrets() { - super("Dungeon.Dungeon Information", "Display # Secrets in current room", "Display what your actionbar says", "dungeon.stats.secretsroom", true, getFontRenderer().getStringWidth("Secrets In Room: 8/8"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display # Secrets in current room", "Display what your actionbar says", "dungeon.stats.secretsroom", true, getFontRenderer().getStringWidth("Secrets In Room: 8/8"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -75,7 +75,7 @@ public class FeatureDungeonCurrentRoomSecrets extends TextHUDFeature implements @Override public List<StyledText> getText() { - if (skyblockStatus.getContext().getBossfightProcessor() != null) return new ArrayList<StyledText>(); + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() != null) return new ArrayList<StyledText>(); List<StyledText> actualBit = new ArrayList<StyledText>(); actualBit.add(new StyledText("Secrets In Room","title")); actualBit.add(new StyledText(": ","separator")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java index bb3d5241..ca5a5cf7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java @@ -16,18 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.events.DungeonDeathEvent; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.events.impl.DungeonDeathEvent; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.scoreboard.ScorePlayerTeam; @@ -41,7 +42,7 @@ import java.util.regex.Pattern; public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener { public FeatureDungeonDeaths() { - super("Dungeon.Dungeon Information", "Display Deaths", "Display names of player and death count in dungeon run", "dungeon.stats.deaths", false, getFontRenderer().getStringWidth("longestplayernamepos: 100"), getFontRenderer().FONT_HEIGHT * 6); + super("Dungeon.HUDs", "Display Deaths", "Display names of player and death count in dungeon run", "dungeon.stats.deaths", false, getFontRenderer().getStringWidth("longestplayernamepos: 100"), getFontRenderer().FONT_HEIGHT * 6); this.setEnabled(false); getStyles().add(new TextStyle("username", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("total", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); @@ -54,7 +55,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener @Override public boolean isHUDViewable() { if (!skyblockStatus.isOnDungeon()) return false; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); return context != null; } @@ -73,7 +74,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener List<StyledText> text= new ArrayList<StyledText>(); - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); Map<String, Integer> deaths = context.getDeaths(); int i = 0; int deathsCnt = 0; @@ -127,7 +128,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener return Integer.parseInt(whatever); } } - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return 0; int d = 0; for (Integer value : context.getDeaths().values()) { @@ -143,7 +144,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { if (clientChatReceivedEvent.type == 2) return; if (!skyblockStatus.isOnDungeon()) return; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return; String txt = clientChatReceivedEvent.message.getFormattedText(); @@ -153,7 +154,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener int deaths = context.getDeaths().getOrDefault(nickname, 0); context.getDeaths().put(nickname, deaths + 1); context.createEvent(new DungeonDeathEvent(nickname, txt, deaths)); - DungeonsGuide.sendDebugChat(new ChatComponentText("Death verified :: "+nickname+" / "+(deaths + 1))); + ChatTransmitter.sendDebugChat(new ChatComponentText("Death verified :: "+nickname+" / "+(deaths + 1))); } Matcher m2 = meDeathPattern.matcher(txt); if (m2.matches()) { @@ -161,7 +162,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener int deaths = context.getDeaths().getOrDefault(nickname, 0); context.getDeaths().put(nickname, deaths + 1); context.createEvent(new DungeonDeathEvent(Minecraft.getMinecraft().thePlayer.getName(), txt, deaths)); - DungeonsGuide.sendDebugChat(new ChatComponentText("Death verified :: me / "+(deaths + 1))); + ChatTransmitter.sendDebugChat(new ChatComponentText("Death verified :: me / "+(deaths + 1))); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java new file mode 100644 index 00000000..135696e1 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java @@ -0,0 +1,508 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; + +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.Ordering; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.MapProcessor; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.BossroomEnterListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonEndListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonStartListener; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TabListUtil; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.*; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.MapData; +import org.jetbrains.annotations.Nullable; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; + +import javax.vecmath.Vector2d; +import java.awt.*; +import java.util.List; + +public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, DungeonStartListener, BossroomEnterListener { + private AColor backgroudColor; + private AColor playerColor; + private boolean shouldCacheMap; + private float playerHeadScale; + private boolean shouldShowOtherPlayers; + private float textScale; + private boolean showSecretCount; + private boolean showPlayerHeads; + private boolean shouldRotateWithPlayer; + private boolean shouldScale; + private float postscaleOfMap; + private boolean centerMapOnPlayer; + + public FeatureDungeonMap() { + super("Dungeon", "Dungeon Map", "Display dungeon map!", "dungeon.map", true, 128, 128); + this.setEnabled(false); + addParameter("scale", new FeatureParameter<>("scale", "Scale map", "Whether to scale map to fit screen", true, "boolean", nval -> shouldScale = nval)); + addParameter("cacheMap", new FeatureParameter<>("cacheMap", "Should cache map data", "name", true, "boolean", nval -> shouldCacheMap = nval)); + addParameter("playerCenter", new FeatureParameter<>("playerCenter", "Center map at player", "Render you in the center", false, "boolean", nval -> centerMapOnPlayer = nval)); + addParameter("rotate", new FeatureParameter<>("rotate", "Rotate map centered at player", "Only works with Center map at player enabled", false, "boolean", nval -> shouldRotateWithPlayer = nval)); + addParameter("postScale", new FeatureParameter<>("postScale", "Scale factor of map", "Only works with Center map at player enabled", 1.0f, "float", nval -> postscaleOfMap = nval)); + addParameter("useplayerheads", new FeatureParameter<>("useplayerheads", "Use player heads instead of arrows", "Option to use player heads instead of arrows", true, "boolean", nval -> showPlayerHeads = nval)); + addParameter("showotherplayers", new FeatureParameter<>("showotherplayers", "Show other players", "Option to show other players in map", true, "boolean", nval -> shouldShowOtherPlayers = nval)); + addParameter("showtotalsecrets", new FeatureParameter<>("showtotalsecrets", "Show Total secrets in the room", "Option to overlay total secrets in the specific room", true, "boolean", nval -> showSecretCount = nval)); + addParameter("playerheadscale", new FeatureParameter<>("playerheadscale", "Player head scale", "Scale factor of player heads, defaults to 1", 1.0f, "float", nval -> playerHeadScale = nval)); + addParameter("textScale", new FeatureParameter<>("textScale", "Text scale", "Scale factor of texts on map, defaults to 1", 1.0f, "float", nval -> textScale = nval)); + + addParameter("border_color", new FeatureParameter<>("border_color", "Color of the border", "Same as name", new AColor(255, 255, 255, 255), "acolor")); + addParameter("background_color", new FeatureParameter<>("background_color", "Color of the background", "Same as name", new AColor(0x22000000, true), "acolor", nval -> backgroudColor = nval)); + addParameter("player_color", new FeatureParameter<>("player_color", "Color of the player border", "Same as name", new AColor(255, 255, 255, 0), "acolor", nval -> playerColor = nval)); + } + + public static final Ordering<NetworkPlayerInfo> sorter = Ordering.from((compare1, compare2) -> { + ScorePlayerTeam scoreplayerteam = compare1.getPlayerTeam(); + ScorePlayerTeam scoreplayerteam1 = compare2.getPlayerTeam(); + return ComparisonChain.start().compareTrueFirst(compare1.getGameType() != WorldSettings.GameType.SPECTATOR, compare2.getGameType() != WorldSettings.GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "").compare(compare1.getGameProfile().getName(), compare2.getGameProfile().getName()).result(); + }); + + private boolean on = false; + + @Override + public void onDungeonEnd() { + on = false; + } + + @Override + public void onDungeonStart() { + on = true; + } + + @Override + public void onBossroomEnter() { + on = false; + } + + @Override + public void drawHUD(float partialTicks) { + if (!on) return; + if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context == null || !context.getMapProcessor().isInitialized()) return; + + MapProcessor mapProcessor = context.getMapProcessor(); + MapData mapData = mapProcessor.getLatestMapData(); + Rectangle featureRect = getFeatureRect().getRectangle(); + Gui.drawRect(0, 0, featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, backgroudColor)); + GlStateManager.color(1, 1, 1, 1); + GlStateManager.pushMatrix(); + if (mapData == null) { + Gui.drawRect(0, 0, featureRect.width, featureRect.height, 0xFFFF0000); + } else { + renderMap(partialTicks, mapProcessor, mapData, context); + } + GlStateManager.popMatrix(); + GL11.glLineWidth(2); + RenderUtils.drawUnfilledBox(0, 0, featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); + } + + @Override + public void drawDemo(float partialTicks) { + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon() && context != null && context.getMapProcessor().isInitialized() && on) { + drawHUD(partialTicks); + return; + } + Rectangle featureRect = getFeatureRect().getRectangle(); + Gui.drawRect(0, 0, featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, backgroudColor)); + FontRenderer fr = getFontRenderer(); + + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + fr.drawString("Please join a dungeon to see preview", featureRect.width / 2 - fr.getStringWidth("Please join a dungeon to see preview") / 2, featureRect.height / 2 - fr.FONT_HEIGHT / 2, 0xFFFFFFFF); + GL11.glLineWidth(2); + RenderUtils.drawUnfilledBox(0, 0, featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); + } + + public void renderMap(float partialTicks, MapProcessor mapProcessor, MapData mapData, DungeonContext context) { + EntityPlayer p = Minecraft.getMinecraft().thePlayer; + + float postScale = this.centerMapOnPlayer ? postscaleOfMap : 1; + + Rectangle featureRect = getFeatureRect().getRectangle(); + int width = featureRect.width; + + float scale = shouldScale ? width / 128.0f : 1; + + GlStateManager.translate(width / 2d, width / 2d, 0); + GlStateManager.scale(scale, scale, 0); + GlStateManager.scale(postScale, postScale, 0); + + Vector2d pt = mapProcessor.worldPointToMapPointFLOAT(p.getPositionEyes(partialTicks)); + double yaw = p.rotationYaw; + if (this.centerMapOnPlayer) { + if (this.shouldRotateWithPlayer) { + GlStateManager.rotate((float) (180.0 - yaw), 0, 0, 1); + } + GlStateManager.translate(-pt.x, -pt.y, 0); + } else { + GlStateManager.translate(-64, -64, 0); + } + + updateMapTexture(mapData.colors, mapProcessor, context.getDungeonRoomList()); + + render(); + + + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1); + + if (this.showPlayerHeads) { + renderHeads(mapProcessor, mapData, scale, postScale, partialTicks); + } else { + renderArrows(mapData, scale, postScale); + } + + + FontRenderer fr = getFontRenderer(); + if (this.showSecretCount) { + for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { + GlStateManager.pushMatrix(); + + Point mapPt = mapProcessor.roomPointToMapPoint(dungeonRoom.getUnitPoints().get(0)); + GlStateManager.translate(mapPt.x + mapProcessor.getUnitRoomDimension().width / 2d, mapPt.y + mapProcessor.getUnitRoomDimension().height / 2d, 0); + + if (this.centerMapOnPlayer && this.shouldRotateWithPlayer) { + GlStateManager.rotate((float) (yaw - 180), 0, 0, 1); + } + GlStateManager.scale(1 / scale, 1 / scale, 0); + GlStateManager.scale(1 / postScale, 1 / postScale, 0); + GlStateManager.scale(textScale, textScale, 0); + String str = ""; + if (dungeonRoom.getTotalSecrets() == -1) { + str += "? "; + } else if (dungeonRoom.getTotalSecrets() != 0) { + str += dungeonRoom.getTotalSecrets() + " "; + } + + DungeonRoom.RoomState currentState = dungeonRoom.getCurrentState(); + switch (currentState) { + case FINISHED: + case COMPLETE_WITHOUT_SECRETS: + str += "✔"; + break; + case DISCOVERED: + str += "☐"; + break; + case FAILED: + str += "❌"; + break; + } + + + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (currentState == DungeonRoom.RoomState.FINISHED) { + fr.drawString(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), 0xFF00FF00); + } else { + if (dungeonRoom.getColor() == 74) { + fr.drawString(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), 0xff000000); + } else { + fr.drawString(str, -(fr.getStringWidth(str) / 2), -(fr.FONT_HEIGHT / 2), 0xFFFFFFFF); + } + } + + GlStateManager.popMatrix(); + } + } + + } + + + private final DynamicTexture mapTexture = new DynamicTexture(128, 128); + private final ResourceLocation generatedMapTexture = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("dungeonmap/map", mapTexture); + private final int[] mapTextureData = mapTexture.getTextureData(); + + private void updateMapTexture(byte[] colors, MapProcessor mapProcessor, List<DungeonRoom> dungeonRooms) { + + if(shouldCacheMap){ + if(!didMapChange(dungeonRooms)){ + return; + } + } + + + for (int i = 0; i < 16384; ++i) { + int j = colors[i] & 255; + + if (j / 4 == 0) { + this.mapTextureData[i] = 0x00000000; + } else { + this.mapTextureData[i] = MapColor.mapColorArray[j / 4].getMapColor(j & 3); + } + } + + if (this.showSecretCount) { + for (DungeonRoom dungeonRoom : dungeonRooms) { + for (Point pt : dungeonRoom.getUnitPoints()) { + for (int y1 = 0; y1 < mapProcessor.getUnitRoomDimension().height; y1++) { + for (int x1 = 0; x1 < mapProcessor.getUnitRoomDimension().width; x1++) { + int x = MathHelper.clamp_int(pt.x * (mapProcessor.getUnitRoomDimension().width + mapProcessor.getDoorDimensions().height) + x1 + mapProcessor.getTopLeftMapPoint().x, 0, 128); + int y = MathHelper.clamp_int(pt.y * (mapProcessor.getUnitRoomDimension().height + mapProcessor.getDoorDimensions().height) + y1 + mapProcessor.getTopLeftMapPoint().y, 0, 128); + int i = y * 128 + x; + int j = dungeonRoom.getColor(); + + if (j / 4 == 0) { + this.mapTextureData[i] = 0x00000000; + } else { + this.mapTextureData[i] = MapColor.mapColorArray[j / 4].getMapColor(j & 3); + } + } + } + } + } + } + + + this.mapTexture.updateDynamicTexture(); + } + + int[] lastRoomColors = new int[50]; + + int[] lastRoomSecrets = new int[50]; + + private boolean didMapChange(List<DungeonRoom> dungeonRooms) { + int[] currentRoomColors = new int[50]; + int[] currentRoomSecrets = new int[50]; + + for (int i = 0; i < dungeonRooms.size(); i++) { + DungeonRoom dungeonRoom = dungeonRooms.get(i); + + currentRoomSecrets[i] = dungeonRoom.getTotalSecrets(); + currentRoomColors[i] = dungeonRoom.getColor(); + + } + + for (int i = 0; i < 50; i++) { + if(lastRoomColors[i] != currentRoomColors[i] || lastRoomSecrets[i] != currentRoomSecrets[i]) { + lastRoomColors = currentRoomColors; + lastRoomSecrets = currentRoomSecrets; + return true; + } + } + + lastRoomColors = currentRoomColors; + lastRoomSecrets = currentRoomSecrets; + return false; + } + + @Nullable + public Tuple<String[], List<NetworkPlayerInfo>> loadPlayerList() { + String[] names = new String[21]; + + List<NetworkPlayerInfo> networkList = sorter.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); + if (networkList.size() < 40) return null; + + for (int i = 0; i < 20; i++) { + names[i] = TabListUtil.getPlayerNameWithChecks(networkList.get(i)); + } + + return new Tuple<>(names, networkList); + } + + long nextRefresh; + + Tuple<String[], List<NetworkPlayerInfo>> playerListCached; + + public Tuple<String[], List<NetworkPlayerInfo>> getPlayerListCached(){ + if(playerListCached == null || nextRefresh <= System.currentTimeMillis()){ + ChatTransmitter.sendDebugChat("Refreshing players on map"); + playerListCached = loadPlayerList(); + nextRefresh = System.currentTimeMillis() + 10000; + } + return playerListCached; + } + + + private void renderHeads(MapProcessor mapProcessor, MapData mapData, float scale, float postScale, float partialTicks) { + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + + Tuple<String[], List<NetworkPlayerInfo>> playerList = getPlayerListCached(); + + List<NetworkPlayerInfo> networkList = playerList.getSecond(); + String[] names = playerList.getFirst(); + + + + // 21 iterations bc we only want to scan the player part of tab list + for (int i = 1; i < 20; i++) { + NetworkPlayerInfo networkPlayerInfo = networkList.get(i); + + String name = names[i]; + if (name == null) continue; + + + EntityPlayer entityplayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(name); + + Vector2d pt2 = null; + double yaw2 = 0; + + if (entityplayer != null && (!entityplayer.isInvisible() || entityplayer == thePlayer)) { + // getting location from player entity + pt2 = mapProcessor.worldPointToMapPointFLOAT(entityplayer.getPositionEyes(partialTicks)); + yaw2 = entityplayer.prevRotationYawHead + (entityplayer.rotationYawHead - entityplayer.prevRotationYawHead) * partialTicks; + if(DungeonsGuide.getDungeonsGuide().verbose) System.out.println("Got player location from entity"); + } +// else { +// // getting player location from map +// String iconName = mapProcessor.getMapIconToPlayerMap().get(name); +// if (iconName != null) { +// Vec4b vec = mapData.mapDecorations.get(iconName); +// if (vec != null) { +// System.out.println("Got player location from map"); +// pt2 = new Vector2d(vec.func_176112_b() / 2d + 64, vec.func_176113_c() / 2d + 64); +// yaw2 = vec.func_176111_d() * 360 / 16.0f; +// } else { +// System.out.println("Failed getting location from map, vec is null"); +// } +// } else { +// System.out.println("Failed getting location from map, icon name is null"); +// } +// } + + if(pt2 == null) return; + + if (entityplayer == thePlayer || shouldShowOtherPlayers) { + drawHead(scale, postScale, networkPlayerInfo, entityplayer, pt2, (float) yaw2); + } + + } + } + + /** + * @param scale Scale of the map + * @param postScale + * @param networkPlayerInfo + * @param entityplayer + * @param pt2 + * @param yaw2 + */ + private void drawHead(float scale, float postScale, NetworkPlayerInfo networkPlayerInfo, EntityPlayer entityplayer, Vector2d pt2, float yaw2) { + GlStateManager.pushMatrix(); + boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE); + GlStateManager.enableTexture2D(); + Minecraft.getMinecraft().getTextureManager().bindTexture(networkPlayerInfo.getLocationSkin()); + int l2 = 8 + (flag1 ? 8 : 0); + int i3 = 8 * (flag1 ? -1 : 1); + + GlStateManager.translate(pt2.x, pt2.y, 0); + GlStateManager.rotate(yaw2, 0, 0, 1); + + GlStateManager.scale(1 / scale, 1 / scale, 0); + GlStateManager.scale(1 / postScale, 1 / postScale, 0); + + GlStateManager.scale(playerHeadScale, playerHeadScale, 0); + + // cutting out the player head out of the skin texture + Gui.drawScaledCustomSizeModalRect(-4, -4, 8.0F, l2, 8, i3, 8, 8, 64.0F, 64.0F); + GL11.glLineWidth(1); + RenderUtils.drawUnfilledBox(-4, -4, 4, 4, this.playerColor); + GlStateManager.popMatrix(); + } + + + private static final ResourceLocation mapIcons = new ResourceLocation("textures/map/map_icons.png"); + + private void renderArrows(MapData mapData, float scale, float postScale) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int k = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(mapIcons); + for (Vec4b vec4b : mapData.mapDecorations.values()) { + if (vec4b.func_176110_a() == 1 || this.shouldShowOtherPlayers) { + GlStateManager.pushMatrix(); + GlStateManager.translate(vec4b.func_176112_b() / 2.0F + 64.0F, vec4b.func_176113_c() / 2.0F + 64.0F, -0.02F); + GlStateManager.rotate((vec4b.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F); + + GlStateManager.scale(1 / scale, 1 / scale, 0); + GlStateManager.scale(1 / postScale, 1 / postScale, 0); + GlStateManager.scale(this.playerHeadScale * 5, this.playerHeadScale * 5, 0); + + GlStateManager.translate(-0.125F, 0.125F, 0.0F); + byte b0 = vec4b.func_176110_a(); + float f1 = (b0 % 4) / 4.0F; + float f2 = (b0 / 4f) / 4.0F; + float f3 = (b0 % 4 + 1) / 4.0F; + float f4 = (b0 / 4f + 1) / 4.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-1.0D, 1.0D, k * -0.001F).tex(f1, f2).endVertex(); + worldrenderer.pos(1.0D, 1.0D, k * -0.001F).tex(f3, f2).endVertex(); + worldrenderer.pos(1.0D, -1.0D, k * -0.001F).tex(f3, f4).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, k * -0.001F).tex(f1, f4).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + ++k; + } + } + } + + private void render() { + int i = 0; + int j = 0; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f = 0.0F; + Minecraft.getMinecraft().getTextureManager().bindTexture(this.generatedMapTexture); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1); + GlStateManager.disableAlpha(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((i) + f, (j + 128) - f, -0.009999999776482582D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos((i + 128) - f, (j + 128) - f, -0.009999999776482582D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos((i + 128) - f, (j) + f, -0.009999999776482582D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos((i) + f, (j) + f, -0.009999999776482582D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 0.0F, -0.04F); + GlStateManager.scale(1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java index e9819690..270b1d75 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java @@ -16,18 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.scoreboard.ScorePlayerTeam; @@ -41,7 +42,7 @@ import java.util.regex.Pattern; public class FeatureDungeonMilestone extends TextHUDFeature implements ChatListener { public FeatureDungeonMilestone() { - super("Dungeon.Dungeon Information", "Display Current Class Milestone", "Display current class milestone of yourself", "dungeon.stats.milestone", true, getFontRenderer().getStringWidth("Milestone: 12"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display Current Class Milestone", "Display current class milestone of yourself", "dungeon.stats.milestone", true, getFontRenderer().getStringWidth("Milestone: 12"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -95,7 +96,7 @@ public class FeatureDungeonMilestone extends TextHUDFeature implements ChatListe public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { if (clientChatReceivedEvent.type == 2) return; if (!skyblockStatus.isOnDungeon()) return; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return; String txt = clientChatReceivedEvent.message.getFormattedText(); if (milestone_pattern.matcher(txt).matches()) { @@ -103,7 +104,7 @@ public class FeatureDungeonMilestone extends TextHUDFeature implements ChatListe TextUtils.formatTime(FeatureRegistry.DUNGEON_REALTIME.getTimeElapsed()), TextUtils.formatTime(FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed()) }); - DungeonsGuide.sendDebugChat(new ChatComponentText("Reached Milestone At " + TextUtils.formatTime(FeatureRegistry.DUNGEON_REALTIME.getTimeElapsed()) + " / "+TextUtils.formatTime(FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed()))); + ChatTransmitter.sendDebugChat(new ChatComponentText("Reached Milestone At " + TextUtils.formatTime(FeatureRegistry.DUNGEON_REALTIME.getTimeElapsed()) + " / "+TextUtils.formatTime(FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed()))); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java index 90f6dd01..68117523 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java @@ -16,16 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonQuitListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonStartListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonQuitListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonStartListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import java.util.ArrayList; import java.util.Arrays; @@ -33,7 +32,7 @@ import java.util.List; public class FeatureDungeonRealTime extends TextHUDFeature implements DungeonStartListener, DungeonQuitListener { public FeatureDungeonRealTime() { - super("Dungeon.Dungeon Information", "Display Real Time-Dungeon Time", "Display how much real time has passed since dungeon run started", "dungeon.stats.realtime", true, getFontRenderer().getStringWidth("Time(Real): 59m 59s"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display Real Time-Dungeon Time", "Display how much real time has passed since dungeon run started", "dungeon.stats.realtime", true, getFontRenderer().getStringWidth("Time(Real): 59m 59s"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("discriminator", new AColor(0xAA,0xAA,0xAA,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java index 03217b30..d0bea24f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java @@ -16,21 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.network.NetworkPlayerInfo; -import net.minecraft.scoreboard.ScorePlayerTeam; import java.awt.*; import java.util.ArrayList; @@ -39,7 +36,7 @@ import java.util.List; public class FeatureDungeonRoomName extends TextHUDFeature { public FeatureDungeonRoomName() { - super("Dungeon.Dungeon Information", "Display name of the room you are in", "Display name of the room you are in", "dungeon.roomname", false, getFontRenderer().getStringWidth("You're in puzzle-tictactoe"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display name of the room you are in", "Display name of the room you are in", "dungeon.roomname", false, getFontRenderer().getStringWidth("You're in puzzle-tictactoe"), getFontRenderer().FONT_HEIGHT); getStyles().add(new TextStyle("in", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("roomname", new AColor(0x55, 0xFF,0xFF,255), new AColor(0, 0,0,0), false)); } @@ -47,7 +44,7 @@ public class FeatureDungeonRoomName extends TextHUDFeature { SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public int getTotalSecretsInt() { - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); int totalSecrets = 0; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { if (dungeonRoom.getTotalSecrets() != -1) @@ -64,7 +61,7 @@ public class FeatureDungeonRoomName extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getMapProcessor() != null; + return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getMapProcessor() != null; } @Override @@ -81,8 +78,8 @@ public class FeatureDungeonRoomName extends TextHUDFeature { public List<StyledText> getText() { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - Point roomPt = skyblockStatus.getContext().getMapProcessor().worldPointToRoomPoint(player.getPosition()); - DungeonRoom dungeonRoom = skyblockStatus.getContext().getRoomMapper().get(roomPt); + Point roomPt = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getMapProcessor().worldPointToRoomPoint(player.getPosition()); + DungeonRoom dungeonRoom = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getRoomMapper().get(roomPt); List<StyledText> actualBit = new ArrayList<StyledText>(); actualBit.add(new StyledText("You're in ","in")); if (dungeonRoom == null) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSBTime.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java index c4591be8..437ed653 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSBTime.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; @@ -41,7 +41,7 @@ public class FeatureDungeonSBTime extends TextHUDFeature { private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public FeatureDungeonSBTime() { - super("Dungeon.Dungeon Information", "Display Ingame Dungeon Time", "Display how much time skyblock thinks has passed since dungeon run started", "dungeon.stats.igtime", true, getFontRenderer().getStringWidth("Time(IG): 1h 59m 59s"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display Ingame Dungeon Time", "Display how much time skyblock thinks has passed since dungeon run started", "dungeon.stats.igtime", true, getFontRenderer().getStringWidth("Time(IG): 1h 59m 59s"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("discriminator", new AColor(0xAA,0xAA,0xAA,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java index 72aaabd6..79f6ee21 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java @@ -16,28 +16,22 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.listener.StompConnectedListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.stomp.StompInterface; -import kr.syeyoung.dungeonsguide.stomp.StompMessageHandler; -import kr.syeyoung.dungeonsguide.stomp.StompPayload; -import kr.syeyoung.dungeonsguide.stomp.StompSubscription; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.utils.TimeScoreUtil; -import kr.syeyoung.dungeonsguide.wsresource.StaticResource; -import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TimeScoreUtil; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResource; +import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.client.Minecraft; @@ -48,15 +42,14 @@ import net.minecraft.util.MathHelper; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; public class FeatureDungeonScore extends TextHUDFeature { public FeatureDungeonScore() { - super("Dungeon.Dungeon Information", "Display Current Score", "Calculate and Display current score\nThis data is from pure calculation and can be different from actual score.", "dungeon.stats.score", false, 200, getFontRenderer().FONT_HEIGHT * 4); + super("Dungeon.HUDs", "Display Current Score", "Calculate and Display current score\nThis data is from pure calculation and can be different from actual score.", "dungeon.stats.score", false, 200, getFontRenderer().FONT_HEIGHT * 4); this.setEnabled(false); - parameters.put("verbose", new FeatureParameter<Boolean>("verbose", "Show each score instead of sum", "Skill: 100 Explore: 58 S->S+(5 tombs) instead of Score: 305", true, "boolean")); + addParameter("verbose", new FeatureParameter<Boolean>("verbose", "Show each score instead of sum", "Skill: 100 Explore: 58 S->S+(5 tombs) instead of Score: 305", true, "boolean")); getStyles().add(new TextStyle("scorename", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -182,9 +175,6 @@ public class FeatureDungeonScore extends TextHUDFeature { private int deaths; } - public int getPercentage() { - return skyblockStatus.getPercentage(); - } public int getCompleteRooms() { for (NetworkPlayerInfo networkPlayerInfoIn : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { String name = networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName()); @@ -198,7 +188,7 @@ public class FeatureDungeonScore extends TextHUDFeature { public int getTotalRooms() { int compRooms = getCompleteRooms(); if (compRooms == 0) return 100; - return (int) (100 * (compRooms / (double)getPercentage())); + return (int) (100 * (compRooms / (double) DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getPercentage())); } public int getUndiscoveredPuzzles() { int cnt = 0; @@ -213,7 +203,7 @@ public class FeatureDungeonScore extends TextHUDFeature { public ScoreCalculation calculateScore() { if (!skyblockStatus.isOnDungeon()) return null; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return null; if (!context.getMapProcessor().isInitialized()) return null; @@ -273,7 +263,7 @@ public class FeatureDungeonScore extends TextHUDFeature { totalSecretsKnown = FeatureRegistry.DUNGEON_SECRETS.sureOfTotalSecrets(); fullyCleared = completed >= getTotalRooms() && context.getMapProcessor().getUndiscoveredRoom() == 0; - explorer += MathHelper.clamp_int((int) Math.floor(6.0 / 10.0 * (context.getMapProcessor().getUndiscoveredRoom() != 0 ? getPercentage() : completed / total * 100)), 0, 60); + explorer += MathHelper.clamp_int((int) Math.floor(6.0 / 10.0 * (context.getMapProcessor().getUndiscoveredRoom() != 0 ? DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getPercentage() : completed / total * 100)), 0, 60); explorer += MathHelper.clamp_int((int) Math.floor(40 * (secrets = FeatureRegistry.DUNGEON_SECRETS.getSecretsFound()) / Math.ceil(totalSecrets * context.getSecretPercentage())),0,40); } int time = 0; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java index 57174669..a5a444c2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.scoreboard.ScorePlayerTeam; @@ -37,7 +37,7 @@ import java.util.List; public class FeatureDungeonSecrets extends TextHUDFeature { public FeatureDungeonSecrets() { - super("Dungeon.Dungeon Information", "Display Total # of Secrets", "Display how much total secrets have been found in a dungeon run.\n+ sign means DG does not know the correct number, but it's somewhere above that number.", "dungeon.stats.secrets", true, getFontRenderer().getStringWidth("Secrets: 999/999+ of 999+"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display Total # of Secrets", "Display how much total secrets have been found in a dungeon run.\n+ sign means DG does not know the correct number, but it's somewhere above that number.", "dungeon.stats.secrets", true, getFontRenderer().getStringWidth("Secrets: 999/999+ of 999+"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -71,7 +71,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { public int getTotalSecretsInt() { if (getSecretsFound() != 0) return (int) Math.ceil (getSecretsFound() / getSecretPercentage() * 100); - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); int totalSecrets = 0; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { if (dungeonRoom.getTotalSecrets() != -1) @@ -81,7 +81,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { } public boolean sureOfTotalSecrets() { if (getSecretsFound() != 0) return true; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context.getMapProcessor().getUndiscoveredRoom() > 0) return false; boolean allknown = true; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { @@ -91,7 +91,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { } public String getTotalSecrets() { - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return "?"; int totalSecrets = 0; boolean allknown = true; @@ -136,7 +136,8 @@ public class FeatureDungeonSecrets extends TextHUDFeature { actualBit.add(new StyledText(": ","separator")); actualBit.add(new StyledText(getSecretsFound() +"","currentSecrets")); actualBit.add(new StyledText("/","separator2")); - actualBit.add(new StyledText((int)Math.ceil(getTotalSecretsInt() * DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext().getSecretPercentage())+" of "+getTotalSecretsInt(),"totalSecrets")); + + actualBit.add(new StyledText((int)Math.ceil(getTotalSecretsInt() * DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getSecretPercentage())+" of "+getTotalSecretsInt(),"totalSecrets")); actualBit.add(new StyledText(getTotalSecrets().contains("+") ? "+" : "","unknown")); return actualBit; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonTombs.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java index 4a3fb2cd..3290b831 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonTombs.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.scoreboard.ScorePlayerTeam; @@ -35,7 +35,7 @@ import java.util.List; public class FeatureDungeonTombs extends TextHUDFeature { public FeatureDungeonTombs() { - super("Dungeon.Dungeon Information", "Display # of Crypts", "Display how much total crypts have been blown up in a dungeon run", "dungeon.stats.tombs", true, getFontRenderer().getStringWidth("Crypts: 42"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs", "Display # of Crypts", "Display how much total crypts have been blown up in a dungeon run", "dungeon.stats.tombs", true, getFontRenderer().getStringWidth("Crypts: 42"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureHideNameTags.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java index 13836a73..994a1891 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureHideNameTags.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.EntityLivingRenderListener; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.EntityLivingRenderListener; import net.minecraft.entity.item.EntityArmorStand; import net.minecraftforge.client.event.RenderLivingEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java index 1609a5c2..5255ac7a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.PlayerRenderListener; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.PlayerRenderListener; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; @@ -50,7 +50,7 @@ public class FeaturePlayerESP extends SimpleFeature implements PlayerRenderListe if (!isEnabled()) return; - DungeonContext dungeonContext = skyblockStatus.getContext(); + DungeonContext dungeonContext = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (dungeonContext == null) return; if (!dungeonContext.getPlayers().contains(renderPlayerEvent.entityPlayer.getName())) { return; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java index e0dc7f97..8ae1c3e5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.impl.boss.FeatureChestPrice; -import kr.syeyoung.dungeonsguide.features.listener.GuiClickListener; -import kr.syeyoung.dungeonsguide.features.listener.KeyInputListener; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.impl.boss.FeatureChestPrice; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiClickListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.KeyInputListener; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiChest; @@ -35,7 +35,7 @@ import org.lwjgl.input.Mouse; public class FeaturePressAnyKeyToCloseChest extends SimpleFeature implements KeyInputListener, GuiClickListener { public FeaturePressAnyKeyToCloseChest() { super("Dungeon", "Press Any Mouse Button or Key to close Secret Chest", "dungeon.presskeytoclose"); - parameters.put("threshold", new FeatureParameter<Integer>("threshold", "Price Threshold", "The maximum price of item for chest to be closed. Default 1m", 1000000, "integer")); + addParameter("threshold", new FeatureParameter<Integer>("threshold", "Price Threshold", "The maximum price of item for chest to be closed. Default 1m", 1000000, "integer")); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java index 6b990f7c..a61d6966 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; @@ -40,7 +40,7 @@ import java.util.List; public class FeatureWarnLowHealth extends TextHUDFeature { public FeatureWarnLowHealth() { super("Dungeon.Teammates", "Low Health Warning", "Warn if someone is on low health", "dungeon.lowhealthwarn", false, 500, 20); - parameters.put("threshold", new FeatureParameter<Integer>("threshold", "Health Threshold", "Health Threshold for this feature to be toggled. default to 500", 500, "integer")); + addParameter("threshold", new FeatureParameter<Integer>("threshold", "Health Threshold", "Health Threshold for this feature to be toggled. default to 500", 500, "integer")); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("number", new AColor(0xFF, 0x55,0x55,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java index d9354137..5c931910 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.dungeon; +package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonEndListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.util.ArrayList; @@ -71,7 +71,7 @@ public class FeatureWatcherWarning extends TextHUDFeature implements ChatListene public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { if (clientChatReceivedEvent.message.getFormattedText().equals("§r§c[BOSS] The Watcher§r§f: That will be enough for now.§r")) { warning = System.currentTimeMillis() + 2500; - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context ==null) return; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { if (dungeonRoom != null && dungeonRoom.getColor() == 18) diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java index 0cb126ef..7222f585 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.chat.ChatProcessor; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; public class FeatureAutoAcceptReparty extends SimpleFeature implements ChatListener { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureCooldownCounter.java index 2bdf607e..ae740803 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureCooldownCounter.java @@ -16,28 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.features.listener.DungeonQuitListener; -import kr.syeyoung.dungeonsguide.features.listener.GuiOpenListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonQuitListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiOpenListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.ContainerChest; import net.minecraftforge.client.event.GuiOpenEvent; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; -import java.awt.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureCopyMessages.java index cda0eb7a..f4c3ef91 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureCopyMessages.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.event.ClickEvent; import net.minecraft.event.HoverEvent; import net.minecraft.util.ChatComponentText; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDecreaseExplosionSound.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java index a382e646..aef65de2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDecreaseExplosionSound.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java @@ -16,27 +16,24 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.SoundListener; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.SoundListener; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraftforge.client.event.sound.PlaySoundEvent; public class FeatureDecreaseExplosionSound extends SimpleFeature implements SoundListener { public FeatureDecreaseExplosionSound() { super("Misc", "Decrease Explosion sound effect", "Decreases volume of explosions while on skyblock", "qol.explosionsound"); - parameters.put("sound", new FeatureParameter<Float>("sound", "Sound Multiplier %", "The volume of explosion effect will be multiplied by this value. 0~100", 10.0f, "float")); + addParameter("sound", new FeatureParameter<Float>("sound", "Sound Multiplier %", "The volume of explosion effect will be multiplied by this value. 0~100", 10.0f, "float")); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public void onSound(PlaySoundEvent soundEvent) { - if (!skyblockStatus.isOnSkyblock()) return; + if (!SkyblockStatus.isOnSkyblock()) return; if (soundEvent.name.equalsIgnoreCase("random.explode") && soundEvent.result instanceof PositionedSoundRecord) { PositionedSoundRecord positionedSoundRecord = (PositionedSoundRecord) soundEvent.result; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDisableMessage.java index b530a444..afce7bc7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureDisableMessage.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDisableMessage.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -57,17 +56,16 @@ public class FeatureDisableMessage extends SimpleFeature implements ChatListener public FeatureDisableMessage() { super("Misc.Chat", "Disable ability messages", "Do not let ability messages show up in chatbox\nclick on Edit for more precise settings", "fixes.messagedisable", true); for (MessageData messageData : PRE_DEFINED) { - this.parameters.put(messageData.key, new FeatureParameter<Boolean>(messageData.key, messageData.name, messageData.description, true, "boolean")); + addParameter(messageData.key, new FeatureParameter<Boolean>(messageData.key, messageData.name, messageData.description, true, "boolean")); } } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { if (clientChatReceivedEvent.type == 2) return; if (!isEnabled()) return; - if (!skyblockStatus.isOnSkyblock()) return; + if (!SkyblockStatus.isOnSkyblock()) return; String msg = clientChatReceivedEvent.message.getFormattedText(); for (MessageData md:PRE_DEFINED) { if (this.<Boolean>getParameter(md.key).getValue() && md.pattern.matcher(msg).matches()) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java new file mode 100644 index 00000000..f88b2884 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java @@ -0,0 +1,156 @@ +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessResult; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.utils.ScoreBoardUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TitleRender; +import net.minecraft.client.Minecraft; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.Map; +import java.util.Objects; + +import static kr.syeyoung.dungeonsguide.mod.chat.ChatProcessResult.NONE; +import static kr.syeyoung.dungeonsguide.mod.chat.ChatProcessResult.REMOVE_CHAT; + +/** + * CREDITS FOR THE COUNTDOWN SOUNDTRACK: <a href="https://www.youtube.com/watch?v=acCqrA-JxAw">...</a> + */ +public class FeatureEpicCountdown extends SimpleFeature { + + static volatile long updatedAt; + static volatile int secondsLeft; + private static boolean cleanChat; + private boolean sfxenabled; + + int actualSecondsLeft; + + public FeatureEpicCountdown() { + super("Dungeon.HUDs", "Epic Dungeon Start Countdown", "Shows a cool dungeon start instead of the chat messages", "etc.dungeoncountdown", true); + addParameter("cleanchat", new FeatureParameter<>("cleanchat", "Clean Dungeon Chat", "^^^", true, "boolean", nval -> cleanChat = nval)); + addParameter("sounds", new FeatureParameter<>("sounds", "Countdown SFX", "^^^", true, "boolean", nval -> sfxenabled = nval)); + + lastSec = GO_TEXT; + + ChatProcessor.INSTANCE.subscribe(FeatureEpicCountdown::processChat); + MinecraftForge.EVENT_BUS.register(this); + } + + public static ChatProcessResult processChat(String txt, Map<String, Object> context) { + if(cleanChat){ + if(txt.startsWith("§e[NPC] §bMort§f: §rTalk to me to change your class and ready up.§r")){ + return REMOVE_CHAT; + } + if(txt.startsWith("§r§aYour active Potion Effects have been paused and stored.")){ + return REMOVE_CHAT; + } + if(txt.startsWith("§e[NPC] §bMort§f: §rGood luck.§r")){ + return REMOVE_CHAT; + } + if(txt.startsWith("§e[NPC] §bMort§f: §rYou should find it useful if you get lost.§r")){ + return REMOVE_CHAT; + } + if(TextUtils.stripColor(txt).contains("[NPC] Mort: Here, I found this map")){ + return REMOVE_CHAT; + } + if(txt.startsWith("§r§a[Berserk] §r§f")){ + return REMOVE_CHAT; + } + } + + + if (txt.startsWith("§r§aDungeon starts in")) { + String striped = TextUtils.stripColor(txt); + + String secondsStr = striped.replace("Dungeon starts in ", ""); + secondsStr = secondsStr.replace(" seconds.", ""); + secondsStr = secondsStr.replace(" second.", ""); + + secondsLeft = Integer.parseInt(secondsStr); + updatedAt = System.currentTimeMillis(); + + return REMOVE_CHAT; + } + + return NONE; + + } + + static final String GO_TEXT = "GO!!!"; + String lastSec; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent e){ + if(e.phase != TickEvent.Phase.START || !isEnabled() || !DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + + + ScoreBoardUtils.forEachLineClean(line -> { + if(line.contains("Starting in:")){ + String time = line.replace("Starting in: ", "").replace("§r", "").replace("0:", ""); + if(!time.isEmpty()){ + secondsLeft = Integer.parseInt(time); + updatedAt = System.currentTimeMillis(); + } + } + }); + + +// www.hypixel.net§r +// §r +// Starting in: 0:57§r +// §r +// B kokoniara Lv25§r +// §r +// The Catacombs F3§r +// Late Winter 3rd§r +// §r +// 10/22/22 m65G 28266§r + + } + + + @SubscribeEvent + public void onRender(RenderGameOverlayEvent.Post postRender) { + if (!isEnabled()) return; + if (!(postRender.type == RenderGameOverlayEvent.ElementType.EXPERIENCE || postRender.type == RenderGameOverlayEvent.ElementType.JUMPBAR)) + return; + + long timepassed = System.currentTimeMillis() - updatedAt; + + long secs = timepassed / 1000; + + int actualSecondspassed = (int) secs; + actualSecondsLeft = secondsLeft - actualSecondspassed; + if (actualSecondsLeft <= 0) { + if(!Objects.equals(lastSec, GO_TEXT)){ + lastSec = GO_TEXT; + TitleRender.displayTitle(lastSec, "", 2, 25, 15); + } + return; + } + + String string = "§c" + actualSecondsLeft; + + if(!Objects.equals(string, lastSec)){ + if(actualSecondsLeft == 3 && sfxenabled){ + Minecraft.getMinecraft().thePlayer.playSound("skyblock_dungeons_guide:readysetgo", 1F, 1F); + } + if(actualSecondsLeft > 5){ + TitleRender.displayTitle(string, "", 1, 10, 8); + }else{ + TitleRender.displayTitle(string, "", 1, 6, 4); + } + lastSec = string; + } + + } + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java index f00a34d8..64f2bfe8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java @@ -16,47 +16,33 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; import com.google.common.collect.ImmutableMap; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.PlayerRenderListener; -import kr.syeyoung.dungeonsguide.features.listener.TextureStichListener; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.PlayerRenderListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.TextureStichListener; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.resources.model.IBakedModel; -import net.minecraft.client.resources.model.ModelManager; -import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.*; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.client.model.IModel; import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.client.model.ModelLoaderRegistry; import net.minecraftforge.client.model.obj.OBJLoader; import net.minecraftforge.client.model.obj.OBJModel; -import net.minecraftforge.fml.relauncher.ReflectionHelper; import java.io.IOException; -import java.util.List; public class FeaturePenguins extends SimpleFeature implements PlayerRenderListener, TextureStichListener { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureRepartyCommand.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureRepartyCommand.java index ac01610d..0392d663 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureRepartyCommand.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureRepartyCommand.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureRepartyCommand extends SimpleFeature { public FeatureRepartyCommand() { super("Party.Reparty", "Enable Reparty Command From DG", "if you disable, /dg reparty will still work, Auto reparty will still work\nRequires Restart to get applied", "qol.reparty"); - parameters.put("command", new FeatureParameter<String>("command", "The Command", "Command that the reparty will be bound to", "reparty", "string")); + addParameter("command", new FeatureParameter<String>("command", "The Command", "Command that the reparty will be bound to", "reparty", "string")); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipDungeonStat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureTooltipDungeonStat.java index 12100aac..c58143d5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipDungeonStat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureTooltipDungeonStat.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.TooltipListener; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.TooltipListener; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.event.entity.player.ItemTooltipEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureTooltipPrice.java index 29299f46..419db805 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureTooltipPrice.java @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.TooltipListener; -import kr.syeyoung.dungeonsguide.utils.AhUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.TooltipListener; +import kr.syeyoung.dungeonsguide.mod.utils.AhUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -35,7 +35,7 @@ import java.util.TreeSet; public class FeatureTooltipPrice extends SimpleFeature implements TooltipListener { public FeatureTooltipPrice() { super("Misc.API Features", "Item Price", "Shows price of items", "tooltip.price"); - parameters.put("reqShift", new FeatureParameter<Boolean>("reqShift", "Require Shift", "If shift needs to be pressed in order for this feature to be activated", false, "boolean")); + addParameter("reqShift", new FeatureParameter<Boolean>("reqShift", "Require Shift", "If shift needs to be pressed in order for this feature to be activated", false, "boolean")); setEnabled(false); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureUpdateAlarm.java index a3ee878c..74b8eed8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureUpdateAlarm.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureUpdateAlarm.java @@ -16,34 +16,26 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc; - -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.StompConnectedListener; -import kr.syeyoung.dungeonsguide.features.listener.TickListener; -import kr.syeyoung.dungeonsguide.stomp.StompInterface; -import kr.syeyoung.dungeonsguide.stomp.StompMessageHandler; -import kr.syeyoung.dungeonsguide.stomp.StompPayload; -import kr.syeyoung.dungeonsguide.stomp.StompSubscription; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.events.impl.StompConnectedEvent; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.StompConnectedListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.TickListener; import net.minecraft.client.Minecraft; import net.minecraft.util.ChatComponentText; -public class FeatureUpdateAlarm extends SimpleFeature implements StompConnectedListener, StompMessageHandler, TickListener { +public class FeatureUpdateAlarm extends SimpleFeature implements StompConnectedListener, TickListener { public FeatureUpdateAlarm() { super("Misc", "Update Alarm","Show a warning in chat when a version has been released.", "etc.updatealarm", true); } - private StompPayload stompPayload; - @Override - public void handle(StompInterface stompInterface, StompPayload stompPayload) { - this.stompPayload = stompPayload; - } - + private String stompPayload; @Override public void onTick() { if (stompPayload != null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(stompPayload.payload())); + ChatTransmitter.addToQueue(new ChatComponentText(stompPayload)); stompPayload = null; Minecraft.getMinecraft().thePlayer.playSound("random.successful_hit", 1f,1f); } @@ -51,13 +43,14 @@ public class FeatureUpdateAlarm extends SimpleFeature implements StompConnectedL @Override public void onStompConnected(StompConnectedEvent event) { - event.getStompInterface().subscribe(StompSubscription.builder() - .destination("/topic/updates") - .ackMode(StompSubscription.AckMode.AUTO) - .stompMessageHandler(this).build()); - event.getStompInterface().subscribe(StompSubscription.builder() - .destination("/user/queue/messages") - .ackMode(StompSubscription.AckMode.AUTO) - .stompMessageHandler(this).build()); + + event.getStompInterface().subscribe("/topic/updates", (stompClient ,payload) -> { + this.stompPayload = payload; + }); + + event.getStompInterface().subscribe("/user/queue/messages", (stompClient ,payload) -> { + this.stompPayload = payload; + }); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/FeatureAbilityCooldown.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java index 7b18a3f5..c19b42b2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/FeatureAbilityCooldown.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java @@ -16,18 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc.ability; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc.ability; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.TickListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.TickListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.item.ItemStack; @@ -35,13 +34,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.client.event.ClientChatReceivedEvent; -import java.math.MathContext; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class FeatureAbilityCooldown extends TextHUDFeature implements ChatListener, TickListener { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public FeatureAbilityCooldown() { super("Misc", "View Ability Cooldowns", "A handy hud for viewing cooldown abilities", "etc.abilitycd2", false, 100, getFontRenderer().FONT_HEIGHT * 5); @@ -50,13 +47,13 @@ public class FeatureAbilityCooldown extends TextHUDFeature implements ChatListen getStyles().add(new TextStyle("number", new AColor(0x55, 0xFF,0xFF,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("unit",new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("ready",new AColor(0xDF, 0x00,0x67,255), new AColor(0, 0,0,0), false)); - this.parameters.put("disable", new FeatureParameter<Boolean>("disable", "Disable outside of dungeon", "Disable the feature when out of dungeon", false, "boolean")); - this.parameters.put("decimal", new FeatureParameter<Integer>("decimal", "Decimal places", "ex) 2 -> Cooldown: 3.21 3-> Cooldown: 3.210", 0, "integer")); + addParameter("disable", new FeatureParameter<Boolean>("disable", "Disable outside of dungeon", "Disable the feature when out of dungeon", false, "boolean")); + addParameter("decimal", new FeatureParameter<Integer>("decimal", "Decimal places", "ex) 2 -> Cooldown: 3.21 3-> Cooldown: 3.210", 0, "integer")); } @Override public boolean isHUDViewable() { - return skyblockStatus.isOnSkyblock() && (!this.<Boolean>getParameter("disable").getValue() || (this.<Boolean>getParameter("disable").getValue() && skyblockStatus.isOnDungeon())); + return SkyblockStatus.isOnSkyblock() && (!this.<Boolean>getParameter("disable").getValue() || (this.<Boolean>getParameter("disable").getValue() && SkyblockStatus.isOnSkyblock())); } @Override @@ -210,6 +207,8 @@ public class FeatureAbilityCooldown extends TextHUDFeature implements ChatListen register(new SkyblockAbility("Rejuvenate", -1, -1, "VAMPIRE_WITCH_MASK")); register(new SkyblockAbility("Terrain Toss", 250, 1, "YETI_SWORD")); register(new SkyblockAbility("Instant Transmission", 50, -1, "ASPECT_OF_THE_END")); + register(new SkyblockAbility("Ether Transmission", 180, -1, "ASPECT_OF_THE_END")); + register(new SkyblockAbility("Ether Transmission", 180, -1, "ASPECT_OF_THE_VOID")); register(new SkyblockAbility("Detonate", -1, 60, "CREEPER_LEGGINGS")); register(new SkyblockAbility("Extreme Focus", -1, -1, "END_STONE_SWORD")); register(new SkyblockAbility("Leap", 50, 1, "LEAPING_SWORD")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/SkyblockAbility.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/SkyblockAbility.java index a7c8a0b9..95dd76a6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/SkyblockAbility.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/SkyblockAbility.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc.ability; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc.ability; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/UsedAbility.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/UsedAbility.java index baea7e44..c25d8fd9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/ability/UsedAbility.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/UsedAbility.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.etc.ability; +package kr.syeyoung.dungeonsguide.mod.features.impl.etc.ability; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/APIKey.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/APIKey.java index ceb4f407..82d15d62 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/APIKey.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/APIKey.java @@ -16,15 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party; - -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.ChatListenerGlobal; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import net.minecraft.client.Minecraft; +package kr.syeyoung.dungeonsguide.mod.features.impl.party; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListenerGlobal; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.util.ChatComponentText; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -32,7 +30,7 @@ public class APIKey extends SimpleFeature implements ChatListenerGlobal { public APIKey() { super("Misc.API Features", "API KEY", "Sets api key","partykicker.apikey"); - parameters.put("apikey", new FeatureParameter<String>("apikey", "API Key", "API key", "","string")); + addParameter("apikey", new FeatureParameter<String>("apikey", "API Key", "API key", "","string")); } public String getAPIKey() { @@ -46,7 +44,7 @@ public class APIKey extends SimpleFeature implements ChatListenerGlobal { String str = clientChatReceivedEvent.message.getFormattedText(); if (str.startsWith("§aYour new API key is §r§b")) { String apiKeys = TextUtils.stripColor(str.split(" ")[5]); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fAutomatically Configured Hypixel API Key")); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §fAutomatically Configured Hypixel API Key")); this.<String>getParameter("apikey").setValue(apiKeys); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeatureGoodParties.java index 6d33ebc9..4d4087ae 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeatureGoodParties.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeatureGoodParties.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party; +package kr.syeyoung.dungeonsguide.mod.features.impl.party; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.GuiPostRenderListener; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiPostRenderListener; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeaturePartyList.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java index ca466452..c7912d9c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeaturePartyList.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party; +package kr.syeyoung.dungeonsguide.mod.features.impl.party; -import kr.syeyoung.dungeonsguide.chat.PartyContext; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.party.PartyContext; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeaturePartyReady.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java index 51285ed9..bf8d8f65 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/FeaturePartyReady.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java @@ -16,19 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.chat.PartyContext; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; -import kr.syeyoung.dungeonsguide.features.listener.DungeonStartListener; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.party; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.DungeonStartListener; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.party.PartyContext; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.util.*; @@ -46,7 +45,7 @@ public class FeaturePartyReady extends TextHUDFeature implements ChatListener, D @Override public boolean isHUDViewable() { - return PartyManager.INSTANCE.getPartyContext() != null && PartyManager.INSTANCE.getPartyContext().isPartyExistHypixel() && "Dungeon Hub".equals(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); + return PartyManager.INSTANCE.getPartyContext() != null && PartyManager.INSTANCE.getPartyContext().isPartyExistHypixel() && "Dungeon Hub".equals(DungeonContext.getDungeonName()); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/FeatureCustomPartyFinder.java index 37669835..87b071bc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/FeatureCustomPartyFinder.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.customgui; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.customgui; -import kr.syeyoung.dungeonsguide.events.WindowUpdateEvent; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.*; +import kr.syeyoung.dungeonsguide.mod.events.impl.WindowUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.*; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; @@ -33,9 +32,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.client.event.GuiOpenEvent; -import java.util.HashSet; -import java.util.Set; - public class FeatureCustomPartyFinder extends SimpleFeature implements GuiOpenListener, GuiUpdateListener { public FeatureCustomPartyFinder() { super("Party","Custom Party Finder","Custom Party Finder", "party.customfinder", true); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/GuiCustomPartyFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/GuiCustomPartyFinder.java index 98b733e5..d6ab22b9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/GuiCustomPartyFinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/GuiCustomPartyFinder.java @@ -16,16 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.customgui; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.customgui; -import kr.syeyoung.dungeonsguide.events.WindowUpdateEvent; -import kr.syeyoung.dungeonsguide.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.events.impl.WindowUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; import lombok.Getter; -import lombok.Setter; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.util.MathHelper; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyFinder.java index eef360b2..634d3ff1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyFinder.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.customgui; - -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfigV2; -import kr.syeyoung.dungeonsguide.events.WindowUpdateEvent; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.discord.invteTooltip.MTooltipInvite; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.rpc.RichPresenceManager; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.customgui; + +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.GuiConfigV2; +import kr.syeyoung.dungeonsguide.mod.events.impl.WindowUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.impl.discord.invteTooltip.MTooltipInvite; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.discord.rpc.RichPresenceManager; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyFinderSettings.java index fe719de2..fa27b517 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyFinderSettings.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.customgui; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.customgui; -import kr.syeyoung.dungeonsguide.chat.ChatProcessor; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gui.elements.*; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; -import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -50,7 +49,7 @@ public class PanelPartyFinderSettings extends MPanelScaledGUI { private MTextField filterWhitelist, filterBlacklist, highlightNote, blacklistClassTxt; private MIntegerSelectionButton integerSelection; - @Getter @Setter + @Getter boolean delistable = false; public void setDelistable(boolean delistable) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyListElement.java index 663cde9f..154c5e8d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/customgui/PanelPartyListElement.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.customgui; - -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltipText; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.customgui; + +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltip; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltipText; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -44,7 +44,6 @@ import net.minecraft.util.EnumChatFormatting; import java.awt.*; import java.util.HashSet; import java.util.List; -import java.util.Locale; import java.util.Set; public class PanelPartyListElement extends MPanel { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FakePlayer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/FakePlayer.java index ec8a29d9..4304ea8a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FakePlayer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/FakePlayer.java @@ -1,10 +1,10 @@ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview; import com.google.common.base.Objects; import com.mojang.authlib.GameProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.SkinFetcher; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.SkinFetcher; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerStatsOnJoin.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/FeatureViewPlayerStatsOnJoin.java index 74beb42f..1be93cdf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerStatsOnJoin.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/FeatureViewPlayerStatsOnJoin.java @@ -16,36 +16,37 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview; import com.mojang.authlib.GameProfile; import io.github.moulberry.hychat.HyChat; import io.github.moulberry.hychat.chat.ChatManager; import io.github.moulberry.hychat.gui.GuiChatBox; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.chat.ChatProcessor; -import kr.syeyoung.dungeonsguide.chat.PartyContext; -import kr.syeyoung.dungeonsguide.chat.PartyManager; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; -import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.ApiFetcher; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.PlayerSkyblockData; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.SkinFetcher; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.DataRendererEditor; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.DataRendererRegistry; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.features.listener.ChatListener; -import kr.syeyoung.dungeonsguide.features.listener.GuiClickListener; -import kr.syeyoung.dungeonsguide.features.listener.GuiPostRenderListener; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessResult; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.mod.cosmetics.CosmeticData; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.ApiFetcher; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.PlayerSkyblockData; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.SkinFetcher; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.DataRendererEditor; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.DataRendererRegistry; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiClickListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiPostRenderListener; +import kr.syeyoung.dungeonsguide.mod.party.PartyContext; +import kr.syeyoung.dungeonsguide.mod.party.PartyManager; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; @@ -56,16 +57,17 @@ import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.event.ClickEvent; import net.minecraft.event.HoverEvent; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.fml.client.config.GuiUtils; import net.minecraftforge.fml.common.Loader; +import org.jetbrains.annotations.NotNull; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; @@ -77,34 +79,108 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; -public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPostRenderListener, ChatListener, GuiClickListener { +public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPostRenderListener, GuiClickListener { + static Minecraft mc = Minecraft.getMinecraft(); + protected Rectangle popupRect; + ChangeProfileWidget profileButtonWidget = new ChangeProfileWidget(); + private String lastuid; // actually current uid + private CompletableFuture<Optional<PlayerSkyblockData>> profileFuture; + private Future<Optional<GameProfile>> gameProfileFuture; + private Future<SkinFetcher.SkinSet> skinFuture; + private FakePlayer fakePlayer; + private boolean shouldDraw = false; public FeatureViewPlayerStatsOnJoin() { super("Party", "View player stats when join", "view player rendering when joining/someone joins the party", "partykicker.viewstats", true); - this.parameters.put("datarenderers", new FeatureParameter<List<String>>("datarenderers", "DataRenderers", "Datarenderssdasd", new ArrayList<>(Arrays.asList( + addParameter("datarenderers", new FeatureParameter<List<String>>("datarenderers", "DataRenderers", "Datarenderssdasd", new ArrayList<>(Arrays.asList( "catalv", "selected_class_lv", "dungeon_catacombs_higheststat", "dungeon_master_catacombs_higheststat", "skill_combat_lv", "skill_foraging_lv", "skill_mining_lv", "fairysouls", "dummy" )), "stringlist")); + ChatProcessor.INSTANCE.subscribe(((txt, messageContext) -> { + + if (isEnabled() && txt.contains("§r§ejoined the dungeon group! (§r§b")) { + String username = TextUtils.stripColor(txt).split(" ")[3]; + if (username.equalsIgnoreCase(mc.getSession().getUsername())) { + PartyManager.INSTANCE.requestPartyList(context -> { + if (context == null) { + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §cBugged Dungeon Party ")); + } else { + processPartyMembers(context); + } + }); + } else { + processMemberJoin(username); + } + + + } + + return ChatProcessResult.NONE; + })); } + public static void clip(ScaledResolution resolution, int x, int y, int width, int height) { + if (width < 0 || height < 0) return; - ChangeProfileWidget profileButtonWidget = new ChangeProfileWidget(); + int scale = resolution.getScaleFactor(); + GL11.glScissor((x) * scale, mc.displayHeight - (y + height) * scale, (width) * scale, height * scale); + } - static Minecraft mc = Minecraft.getMinecraft(); - protected Rectangle popupRect; - private String lastuid; // actually current uid - private CompletableFuture<Optional<PlayerSkyblockData>> profileFuture; - private Future<Optional<GameProfile>> gameProfileFuture; - private Future<SkinFetcher.SkinSet> skinFuture; - private FakePlayer fakePlayer; - private boolean shouldDraw = false; + public static void processPartyMembers(PartyContext context) { + for (String member : context.getPartyRawMembers()) { + processMemberJoin(member); + } + } + + private static void processMemberJoin(@NotNull String username) { + ApiFetcher.fetchUUIDAsync(username) + .thenAccept(a -> { + if (a == null) { + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §e" + username + "§f's Profile §cCouldn't fetch uuid")); + return; + } + + + ApiFetcher.fetchMostRecentProfileAsync(a.get(), FeatureRegistry.PARTYKICKER_APIKEY.getAPIKey()); + + IChatComponent comp = new ChatComponentText("§eDungeons Guide §7:: §e" + username + "§f's Profile ") + .appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new HoverEventRenderPlayer(a.orElse(null))))); + + + IChatComponent kickText = new ChatComponentText(" §cKICK").setChatStyle( + new ChatStyle() + .setChatClickEvent( + new ClickEvent(ClickEvent.Action.RUN_COMMAND, "") { + + boolean fuse = false; + @Override + public Action getAction() { + if(!fuse) { + ChatProcessor.INSTANCE.addToChatQueue("/p kick " + username, null, false); + fuse = true; + } + + return Action.RUN_COMMAND; + } + } + ) + ); + + + comp.appendSibling(kickText); + ChatTransmitter.addToQueue((ChatComponentText) comp); + + + }); + } + @Override public void onGuiPostRender(GuiScreenEvent.DrawScreenEvent.Post rendered) { if (!(mc.currentScreen instanceof GuiChat)) { @@ -189,7 +265,6 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo draw(scaledResolution, mouseX, mouseY, plsSetAPIKEY, playerProfile); } - private void draw(ScaledResolution scaledResolution, int mouseX, int mouseY, boolean plsSetAPIKEY, Optional<PlayerProfile> playerProfile) { GlStateManager.pushMatrix(); GlStateManager.translate(popupRect.x, popupRect.y, 0); @@ -223,7 +298,6 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo Gui.drawRect(2, 195, 88, 218, new Rectangle(2, 195, 86, 23).contains(relX, relY) ? 0xFF859DF0 : 0xFF7289da); - GlStateManager.enableBlend(); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -270,7 +344,6 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo fr.drawString("§eI", 82, 159, -1); - GlStateManager.color(1, 1, 1, 1.0F); if (fakePlayer != null) { drawFakePlayer(scaledResolution, mouseX, mouseY, playerProfile, relX, relY, fr); @@ -405,94 +478,12 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo GlStateManager.pushMatrix(); } - - class ChangeProfileWidget { - public ChangeProfileWidget(){ - fr = Minecraft.getMinecraft().fontRendererObj; - stringWidth = fr.getStringWidth(buttonText); - textx = ((83 - stringWidth) / 2); - texty = (324 - fr.FONT_HEIGHT) / 2; - blockWidth = stringWidth + 3; - blockHeight = fr.FONT_HEIGHT + 2; - } - - FontRenderer fr; - - @Getter @Setter - int currentyselectedprofile = 0; - - String buttonText = "Switch Profile"; - - int stringWidth; - int textx; - int texty; - - int blockWidth; - int blockHeight; - - void drawChangeProfileButton(float relX, float relY){ - - boolean contains = isWithinButtonRec(relX, relY); - - Gui.drawRect(textx - 5, texty - 1, textx + blockWidth, texty + blockHeight, contains ? 0xFFFFFFFF : 0xFF30afd3); - - fr.drawString(buttonText, textx, texty + 2, contains ? 0x30afd3 : 0xFFFFFF); - } - - - Rectangle getButtonRec(){ - return new Rectangle(textx - 5, texty - 1, blockWidth, blockHeight); - } - - boolean isWithinButtonRec(float relX, float relY){ - return getButtonRec().contains(relX, relY); - } - - long clickDeBounce = 0; - void handleClickProfileButton(PlayerSkyblockData playerData){ - - if(System.currentTimeMillis() <= clickDeBounce){ - return; - } else { - clickDeBounce = System.currentTimeMillis() + 200; - } - - ScaledResolution scaledResolution = new ScaledResolution(mc); - int width = scaledResolution.getScaledWidth(); - int height = scaledResolution.getScaledHeight(); - int mouseX = Mouse.getX() * width / mc.displayWidth; - int mouseY = height - Mouse.getY() * height / mc.displayHeight - 1; - - int relX = mouseX - popupRect.x; - int relY = mouseY - popupRect.y; - - if (isWithinButtonRec(relX, relY)) { - if (profileButtonWidget.currentyselectedprofile + 1 >= playerData.getPlayerProfiles().length) { - profileButtonWidget.currentyselectedprofile = 0; - } else { - profileButtonWidget.currentyselectedprofile++; - } - } - } - - PlayerProfile getCurrentrySelectedProfile(PlayerSkyblockData data) { - if (data == null) return null; - if (data.getPlayerProfiles() == null) return null; - if (data.getPlayerProfiles().length == 0) return null; - if (data.getPlayerProfiles().length < currentyselectedprofile) return null; - return data.getPlayerProfiles()[currentyselectedprofile]; - } - } - - - - private void shouldCancelRendering(String uid, int mouseX, int mouseY) { if (!((popupRect != null && (popupRect.contains(mouseX, mouseY) || shouldDraw)) || uid != null && uid.equals(lastuid))) { cancelRender(); } - if (uid != null && !uid.equals(lastuid) && (popupRect==null || (!popupRect.contains(mouseX, mouseY) && !shouldDraw)) ) { + if (uid != null && !uid.equals(lastuid) && (popupRect == null || (!popupRect.contains(mouseX, mouseY) && !shouldDraw))) { cancelRender(); lastuid = uid; } @@ -508,14 +499,6 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo shouldDraw = false; } - - public static void clip(ScaledResolution resolution, int x, int y, int width, int height) { - if (width < 0 || height < 0) return; - - int scale = resolution.getScaleFactor(); - GL11.glScissor((x) * scale, mc.displayHeight - (y + height) * scale, (width) * scale, height * scale); - } - @Override public void onMouseInput(GuiScreenEvent.MouseInputEvent.Pre mouseInputEvent) { ScaledResolution scaledResolution = new ScaledResolution(mc); @@ -524,7 +507,8 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo int mouseX = Mouse.getX() * width / mc.displayWidth; int mouseY = height - Mouse.getY() * height / mc.displayHeight - 1; - if (Mouse.getEventButton() != -1 && Mouse.isButtonDown(Mouse.getEventButton()) && shouldDraw) shouldDraw = false; + if (Mouse.getEventButton() != -1 && Mouse.isButtonDown(Mouse.getEventButton()) && shouldDraw) + shouldDraw = false; if (popupRect == null || !popupRect.contains(mouseX, mouseY)) return; mouseInputEvent.setCanceled(true); @@ -551,17 +535,11 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo // invite ChatProcessor.INSTANCE.addToChatQueue("/p invite " + ApiFetcher.fetchNicknameAsync(profileButtonWidget.getCurrentrySelectedProfile(playerData).getMemberUID()).get().orElse("-"), () -> { }, true); - } - - else if (new Rectangle(2, 170, 86, 23).contains(relX, relY)) { + } else if (new Rectangle(2, 170, 86, 23).contains(relX, relY)) { // kick ChatProcessor.INSTANCE.addToChatQueue("/p kick " + ApiFetcher.fetchNicknameAsync(profileButtonWidget.getCurrentrySelectedProfile(playerData).getMemberUID()).get().orElse("-"), () -> { }, true); - } - - - - else if (new Rectangle(80, 159, 10, 11).contains(relX, relY)) { + } else if (new Rectangle(80, 159, 10, 11).contains(relX, relY)) { shouldDraw = true; } @@ -569,15 +547,12 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo this.profileButtonWidget.handleClickProfileButton(playerData); - } catch (InterruptedException | ExecutionException e) { } } - - public IChatComponent getHoveredComponent(ScaledResolution scaledResolution) { IChatComponent ichatcomponent = null; if (Loader.isModLoaded("hychat")) { @@ -588,62 +563,34 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo int x = guiChatBox.getX(scaledResolution); int y = guiChatBox.getY(scaledResolution); ichatcomponent = guiChatBox.chatArray.getHoveredComponent(guiChatBox.getSelectedTab().getChatLines(), Mouse.getX(), Mouse.getY(), x, y); - } catch (Throwable t) {} + } catch (Throwable t) { + } } if (ichatcomponent == null) { ichatcomponent = Minecraft.getMinecraft().ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); } return ichatcomponent; - -// return Minecraft.getMinecraft().ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); } @Override - public void onChat(ClientChatReceivedEvent event) { - if (!isEnabled()) return; - String str = event.message.getFormattedText(); - if (str.contains("§r§ejoined the dungeon group! (§r§b")) { - String username = TextUtils.stripColor(str).split(" ")[3]; - if (username.equalsIgnoreCase(mc.getSession().getUsername())) { - PartyManager.INSTANCE.requestPartyList(context -> { - if (context == null) { - mc.thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cBugged Dungeon Party ")); - } else { - processPartyMembers(context); - } - }); - } else { - ApiFetcher.fetchUUIDAsync(username) - .thenAccept(a -> { - if (a == null) { - mc.thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + username + "§f's Profile §cCouldn't fetch uuid")); - return; - } - ApiFetcher.fetchMostRecentProfileAsync(a.get(), FeatureRegistry.PARTYKICKER_APIKEY.getAPIKey()); - mc.thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + username + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new FeatureViewPlayerStatsOnJoin.HoverEventRenderPlayer(a.orElse(null)))))); - }); - } - } - } + public String getEditRoute(RootConfigPanel rootConfigPanel) { + ConfigPanelCreator.map.put("base." + getKey(), () -> { - public static void processPartyMembers(PartyContext context) { - for (String member : context.getPartyRawMembers()) { - ApiFetcher.fetchUUIDAsync(member) - .thenAccept(a -> { - if (a == null) { - mc.thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + member + "§f's Profile §cCouldn't fetch uuid")); - } else { - ApiFetcher.fetchMostRecentProfileAsync(a.get(), FeatureRegistry.PARTYKICKER_APIKEY.getAPIKey()); - mc.thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + member + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new HoverEventRenderPlayer(a.orElse(null)))))); - } - }); - } + MFeatureEdit featureEdit = new MFeatureEdit(FeatureViewPlayerStatsOnJoin.this, rootConfigPanel); + featureEdit.addParameterEdit("datarenderers", new DataRendererEditor(FeatureViewPlayerStatsOnJoin.this)); + for (FeatureParameter parameter : getParameters()) { + if (parameter.getKey().equals("datarenderers")) continue; + featureEdit.addParameterEdit(parameter.getKey(), new MParameterEdit(FeatureViewPlayerStatsOnJoin.this, parameter, rootConfigPanel)); + } + return featureEdit; + }); + return "base." + getKey(); } - public static class HoverEventRenderPlayer extends HoverEvent { @Getter private final String uuid; + private IChatComponent cached; public HoverEventRenderPlayer(String uuid) { super(Action.SHOW_TEXT, new ChatComponentText("")); @@ -664,8 +611,6 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo return Objects.hash(super.hashCode(), uuid); } - private IChatComponent cached; - @Override public IChatComponent getValue() { if (cached == null) { @@ -685,19 +630,77 @@ public class FeatureViewPlayerStatsOnJoin extends SimpleFeature implements GuiPo } } + class ChangeProfileWidget { + FontRenderer fr; + @Getter + @Setter + int currentyselectedprofile = 0; + String buttonText = "Switch Profile"; + int stringWidth; + int textx; + int texty; + int blockWidth; + int blockHeight; + long clickDeBounce = 0; + + public ChangeProfileWidget() { + fr = Minecraft.getMinecraft().fontRendererObj; + stringWidth = fr.getStringWidth(buttonText); + textx = ((83 - stringWidth) / 2); + texty = (324 - fr.FONT_HEIGHT) / 2; + blockWidth = stringWidth + 3; + blockHeight = fr.FONT_HEIGHT + 2; + } - @Override - public String getEditRoute(RootConfigPanel rootConfigPanel) { - ConfigPanelCreator.map.put("base." + getKey(), () -> { + void drawChangeProfileButton(float relX, float relY) { - MFeatureEdit featureEdit = new MFeatureEdit(FeatureViewPlayerStatsOnJoin.this, rootConfigPanel); - featureEdit.addParameterEdit("datarenderers", new DataRendererEditor(FeatureViewPlayerStatsOnJoin.this)); - for (FeatureParameter parameter : getParameters()) { - if (parameter.getKey().equals("datarenderers")) continue; - featureEdit.addParameterEdit(parameter.getKey(), new MParameterEdit(FeatureViewPlayerStatsOnJoin.this, parameter, rootConfigPanel)); + boolean contains = isWithinButtonRec(relX, relY); + + Gui.drawRect(textx - 5, texty - 1, textx + blockWidth, texty + blockHeight, contains ? 0xFFFFFFFF : 0xFF30afd3); + + fr.drawString(buttonText, textx, texty + 2, contains ? 0x30afd3 : 0xFFFFFF); + } + + Rectangle getButtonRec() { + return new Rectangle(textx - 5, texty - 1, blockWidth, blockHeight); + } + + boolean isWithinButtonRec(float relX, float relY) { + return getButtonRec().contains(relX, relY); + } + + void handleClickProfileButton(PlayerSkyblockData playerData) { + + if (System.currentTimeMillis() <= clickDeBounce) { + return; + } else { + clickDeBounce = System.currentTimeMillis() + 200; } - return featureEdit; - }); - return "base." + getKey(); + + ScaledResolution scaledResolution = new ScaledResolution(mc); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + int mouseX = Mouse.getX() * width / mc.displayWidth; + int mouseY = height - Mouse.getY() * height / mc.displayHeight - 1; + + int relX = mouseX - popupRect.x; + int relY = mouseY - popupRect.y; + + if (isWithinButtonRec(relX, relY)) { + if (profileButtonWidget.currentyselectedprofile + 1 >= playerData.getPlayerProfiles().length) { + profileButtonWidget.currentyselectedprofile = 0; + } else { + profileButtonWidget.currentyselectedprofile++; + } + } + } + + PlayerProfile getCurrentrySelectedProfile(PlayerSkyblockData data) { + if (data == null) return null; + if (data.getPlayerProfiles() == null) return null; + if (data.getPlayerProfiles().length == 0) return null; + if (data.getPlayerProfiles().length < currentyselectedprofile) return null; + return data.getPlayerProfiles()[currentyselectedprofile]; + } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/ApiFetcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/ApiFetcher.java index c11bc404..32c38440 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/ApiFetcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/ApiFetcher.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.mojang.authlib.GameProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfileParser; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfileParser; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import org.apache.commons.io.IOUtils; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/CachedData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/CachedData.java index e3a98eaa..fd70ec4d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/CachedData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/CachedData.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/PlayerSkyblockData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/PlayerSkyblockData.java new file mode 100644 index 00000000..2525183b --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/PlayerSkyblockData.java @@ -0,0 +1,10 @@ +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api; + +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import lombok.Data; + +@Data +public class PlayerSkyblockData { + PlayerProfile[] playerProfiles; + int lastestprofileArrayIndex; +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/SkinFetcher.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/SkinFetcher.java index 5d9afa4a..00f0925d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/SkinFetcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/SkinFetcher.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/PlayerProfile.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/PlayerProfile.java index 95cd000f..61140679 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/PlayerProfile.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/PlayerProfile.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.*; import lombok.Data; import net.minecraft.item.ItemStack; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/PlayerProfileParser.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/PlayerProfileParser.java index b19e1e36..1ad26bc8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/PlayerProfileParser.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/PlayerProfileParser.java @@ -1,12 +1,12 @@ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonNull; import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.ApiFetcher; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.*; -import kr.syeyoung.dungeonsguide.utils.XPUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.ApiFetcher; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.*; +import kr.syeyoung.dungeonsguide.mod.utils.XPUtils; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/ClassSpecificData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/ClassSpecificData.java index 3496f3a9..eff45140 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/ClassSpecificData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/ClassSpecificData.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonClass.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonClass.java index fc569b57..da32a49b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonClass.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonClass.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonSpecificData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonSpecificData.java index 05975767..a7f95a9f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonSpecificData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonSpecificData.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonStat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonStat.java index be42a509..4e9dab7f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonStat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonStat.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonType.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonType.java index a394214d..0b8e8b37 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonType.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/DungeonType.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import com.google.common.collect.Sets; import lombok.AllArgsConstructor; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/FloorSpecificData.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/FloorSpecificData.java index e31d5034..14ebbcf3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/FloorSpecificData.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/FloorSpecificData.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/Pet.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/Pet.java index 40f15e49..e4a38fe6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/Pet.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/Pet.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/Skill.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/Skill.java index 4ccc1e2d..10f1b1f9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/api/playerprofile/dataclasses/Skill.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/api/playerprofile/dataclasses/Skill.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/DataRendererEditor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/DataRendererEditor.java index 02ab6ea1..2da623b5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/DataRendererEditor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/DataRendererEditor.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/DataRendererRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/DataRendererRegistry.java index b2187511..c0ba020a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/DataRendererRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/DataRendererRegistry.java @@ -16,12 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonClass; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.Skill; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl.*; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonClass; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.Skill; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl.*; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/IDataRenderer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/IDataRenderer.java index 3f2d0ad2..577bdcb5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/IDataRenderer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/IDataRenderer.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonFloorStat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonFloorStat.java index f2cf4a38..b4b4b503 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonFloorStat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonFloorStat.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonSpecificData; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonStat; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.FloorSpecificData; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonSpecificData; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonStat; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.FloorSpecificData; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonHighestFloorStat.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonHighestFloorStat.java index 8daba7eb..07d27b28 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonHighestFloorStat.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRenderDungeonHighestFloorStat.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonSpecificData; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonStat; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.FloorSpecificData; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonSpecificData; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonStat; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.FloorSpecificData; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererClassLv.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererClassLv.java index 8a798eee..d0cdd716 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererClassLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererClassLv.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.ClassSpecificData; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonClass; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.utils.XPUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.ClassSpecificData; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonClass; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.XPUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererDungeonLv.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererDungeonLv.java index 5cc37fa6..5498a4b3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererDungeonLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererDungeonLv.java @@ -16,16 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonSpecificData; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonStat; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.utils.XPUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonSpecificData; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonStat; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.DungeonType; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.XPUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererFairySouls.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererFairySouls.java index 5b8f4d8e..1f0c295f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererFairySouls.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererFairySouls.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererLilyWeight.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererLilyWeight.java index ef57f955..2ecdc8af 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererLilyWeight.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererLilyWeight.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSecrets.java index bacbc598..8a4904a7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSecrets.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSelectedClassLv.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSelectedClassLv.java index d8d3a292..832d9a40 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSelectedClassLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSelectedClassLv.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.ClassSpecificData; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.utils.XPUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.ClassSpecificData; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.XPUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSetUrOwn.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSetUrOwn.java index 3d5e94cc..edff1bc4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSetUrOwn.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSetUrOwn.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSkillLv.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSkillLv.java index ea83a74e..99787d7c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererSkillLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererSkillLv.java @@ -16,14 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.Skill; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.TextUtils; -import kr.syeyoung.dungeonsguide.utils.XPUtils; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.Skill; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; +import kr.syeyoung.dungeonsguide.mod.utils.XPUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererTalismans.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererTalismans.java index 9630e2be..e5db0bda 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/datarenders/impl/DataRendererTalismans.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/playerpreview/datarenders/impl/DataRendererTalismans.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.impl; +package kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.impl; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.datarenders.IDataRenderer; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.PlayerProfile; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.datarenders.IDataRenderer; import lombok.AllArgsConstructor; import lombok.Getter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java index 0b9744ea..bb755bc1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java @@ -16,19 +16,19 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; - -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.actions.Action; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.features.text.StyledText; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.features.text.TextStyle; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; + +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.AbstractAction; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.features.text.StyledText; +import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.mod.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -39,7 +39,7 @@ import java.util.List; public class FeatureActions extends TextHUDFeature { public FeatureActions() { - super("Dungeon Secrets", "Action Viewer", "View List of actions that needs to be taken", "secret.actionview", false, 200, getFontRenderer().FONT_HEIGHT * 10); + super("Dungeon.Secrets", "Action Viewer", "View List of actions that needs to be taken", "secret.actionview", false, 200, getFontRenderer().FONT_HEIGHT * 10); getStyles().add(new TextStyle("pathfinding", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("mechanic", new AColor(0x55, 0xFF,0x55,255), new AColor(0, 0,0,0), false)); @@ -52,7 +52,6 @@ public class FeatureActions extends TextHUDFeature { getStyles().add(new TextStyle("afterline", new AColor(0xAA, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean doesScaleWithHeight() { @@ -61,9 +60,9 @@ public class FeatureActions extends TextHUDFeature { @Override public boolean isHUDViewable() { - if (!skyblockStatus.isOnDungeon()) return false; - if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) return false; - DungeonContext context = skyblockStatus.getContext(); + if (!SkyblockStatus.isOnDungeon()) return false; + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null || !DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getMapProcessor().isInitialized()) return false; + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); @@ -109,7 +108,7 @@ public class FeatureActions extends TextHUDFeature { public List<StyledText> getText() { List<StyledText> actualBit = new ArrayList<StyledText>(); - DungeonContext context = skyblockStatus.getContext(); + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); @@ -125,7 +124,7 @@ public class FeatureActions extends TextHUDFeature { actualBit.add(new StyledText((i == path.getCurrent() ? ">" : " ") +" ","current")); actualBit.add(new StyledText(i+"","number")); actualBit.add(new StyledText(". ","dot")); - Action action = path.getActions().get(i); + AbstractAction action = path.getActions().get(i); String[] str = action.toString().split("\n"); actualBit.add(new StyledText(str[0] + " ","action")); actualBit.add(new StyledText("(","afterline")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureBloodRush.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureBloodRush.java index a0a86bcd..e4bfc7b1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureBloodRush.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureBloodRush.java @@ -16,21 +16,21 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.KeybindPressedListener; -import net.minecraft.client.Minecraft; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.KeybindPressedListener; import net.minecraft.util.ChatComponentText; import org.lwjgl.input.Keyboard; public class FeatureBloodRush extends SimpleFeature implements KeybindPressedListener { public FeatureBloodRush() { - super("Dungeon Secrets.Blood Rush", "Blood Rush Mode", "Auto pathfind to witherdoors. \nCan be toggled with key set in settings", "secret.bloodrush", false); - this.parameters.put("key", new FeatureParameter<Integer>("key", "Key", "Press to toggle Blood Rush", Keyboard.KEY_NONE, "keybind")); + super("Dungeon.Secrets.Blood Rush", "Blood Rush Mode", "Auto pathfind to witherdoors. \nCan be toggled with key set in settings", "secret.bloodrush", false); + addParameter("key", new FeatureParameter<Integer>("key", "Key", "Press to toggle Blood Rush", Keyboard.KEY_NONE, "keybind")); } @Override @@ -38,7 +38,7 @@ public class FeatureBloodRush extends SimpleFeature implements KeybindPressedLis if (keyBindPressedEvent.getKey() == this.<Integer>getParameter("key").getValue()) { setEnabled(!isEnabled()); try { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fToggled Blood Rush to §e"+(FeatureRegistry.SECRET_BLOOD_RUSH.isEnabled() ? "on":"off"))); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §fToggled Blood Rush to §e"+(FeatureRegistry.SECRET_BLOOD_RUSH.isEnabled() ? "on":"off"))); } catch (Exception ignored) {} } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureCreateRefreshLine.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureCreateRefreshLine.java index 1c49b636..7c7cd31a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureCreateRefreshLine.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureCreateRefreshLine.java @@ -16,30 +16,27 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MKeyEditButton; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import org.lwjgl.input.Keyboard; import java.util.LinkedHashMap; public class FeatureCreateRefreshLine extends SimpleFeature { public FeatureCreateRefreshLine() { - super("Dungeon Secrets.Keybinds", "Refresh pathfind line or Trigger pathfind", "A keybind for creating or refresh pathfind lines for pathfind contexts that doesn't have line, or contexts that has refresh rate set to -1.\nPress settings to edit the key", "secret.refreshPathfind", true); + super("Dungeon.Secrets.Keybinds", "Refresh pathfind line or Trigger pathfind", "A keybind for creating or refresh pathfind lines for pathfind contexts that doesn't have line, or contexts that has refresh rate set to -1.\nPress settings to edit the key", "secret.refreshPathfind", true); this.parameters = new LinkedHashMap<>(); - this.parameters.put("key", new FeatureParameter<Integer>("key", "Key","Press to refresh or create pathfind line", Keyboard.KEY_NONE, "keybind")); - this.parameters.put("pathfind", new FeatureParameter<Boolean>("pathfind", "Enable Pathfinding", "Force Enable pathfind for future actions when used", false, "boolean")); - this.parameters.put("refreshrate", new FeatureParameter<Integer>("refreshrate", "Line Refreshrate", "Ticks to wait per line refresh, to be overriden. If the line already has pathfind enabled, this value does nothing. Specify it to -1 to don't refresh line at all", 10, "integer")); + addParameter("key", new FeatureParameter<Integer>("key", "Key","Press to refresh or create pathfind line", Keyboard.KEY_NONE, "keybind")); + addParameter("pathfind", new FeatureParameter<Boolean>("pathfind", "Enable Pathfinding", "Force Enable pathfind for future actions when used", false, "boolean")); + addParameter("refreshrate", new FeatureParameter<Integer>("refreshrate", "Line Refreshrate", "Ticks to wait per line refresh, to be overriden. If the line already has pathfind enabled, this value does nothing. Specify it to -1 to don't refresh line at all", 10, "integer")); } public int getKeybind() {return this.<Integer>getParameter("key").getValue();} public boolean isPathfind() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureFreezePathfind.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureFreezePathfind.java new file mode 100644 index 00000000..16dc46d2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureFreezePathfind.java @@ -0,0 +1,45 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.KeybindPressedListener; +import net.minecraft.util.ChatComponentText; +import org.lwjgl.input.Keyboard; + +public class FeatureFreezePathfind extends SimpleFeature implements KeybindPressedListener { + public FeatureFreezePathfind() { + super("Dungeon.Secrets.Keybinds", "Global Freeze Pathfind", "Freeze Pathfind, meaning the pathfind lines won't change when you move.\nPress settings to edit the key", "secret.freezepathfind", false); + addParameter("key", new FeatureParameter<Integer>("key", "Key", "Press to toggle freeze pathfind", Keyboard.KEY_NONE, "keybind")); + } + + @Override + public void onKeybindPress(KeyBindPressedEvent keyBindPressedEvent) { + if (keyBindPressedEvent.getKey() == this.<Integer>getParameter("key").getValue()) { + setEnabled(!isEnabled()); + try { + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §fToggled Pathfind Freeze to §e"+(FeatureRegistry.SECRET_FREEZE_LINES.isEnabled() ? "on":"off"))); + } catch (Exception ignored) {} + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindStrategy.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeaturePathfindStrategy.java index 9c732dbf..49dd6d58 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindStrategy.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeaturePathfindStrategy.java @@ -16,22 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; import com.google.common.base.Supplier; import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.text.PanelTextParameterConfig; -import kr.syeyoung.dungeonsguide.features.text.StyledTextRenderer; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MStringSelectionButton; -import lombok.Data; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MStringSelectionButton; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -41,8 +37,8 @@ import java.util.stream.Collectors; public class FeaturePathfindStrategy extends SimpleFeature { public FeaturePathfindStrategy() { - super("Dungeon Secrets", "Pathfind Algorithm", "Select pathfind algorithm used by paths", "secret.secretpathfind.algorithm", true); - this.parameters.put("strategy", new FeatureParameter<String>("strategy", "Pathfind Strategy", "Pathfind Strategy", "THETA_STAR", "string")); + super("Dungeon.Secrets.Preferences", "Pathfind Algorithm", "Select pathfind algorithm used by paths", "secret.secretpathfind.algorithm", true); + addParameter("strategy", new FeatureParameter<String>("strategy", "Pathfind Strategy", "Pathfind Strategy", "THETA_STAR", "string")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeaturePathfindToAll.java index 886eefef..9435968f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeaturePathfindToAll.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeaturePathfindToAll extends SimpleFeature { public FeaturePathfindToAll(){ - super("Dungeon Secrets.Pathfind To All", "Start pathfind to all secrets upon entering a room", "Auto browse to all secrets in the room", "secret.secretpathfind.allbrowse", false); - this.parameters.put("bat", new FeatureParameter<Boolean>("bat", "Trigger pathfind to Bat", "This feature will trigger pathfind to all bats in this room when entering a room", true, "boolean")); - this.parameters.put("chest", new FeatureParameter<Boolean>("chest", "Trigger pathfind to Chest", "This feature will trigger pathfind to all chests in this room when entering a room", true, "boolean")); - this.parameters.put("essence", new FeatureParameter<Boolean>("essence", "Trigger pathfind to Essence", "This feature will trigger pathfind to all essences in this room when entering a room", true, "boolean")); - this.parameters.put("itemdrop", new FeatureParameter<Boolean>("itemdrop", "Trigger pathfind to Itemdrop", "This feature will trigger pathfind to all itemdrops in this room when entering a room", true, "boolean")); + super("Dungeon.Secrets.Pathfind To All", "Start pathfind to all secrets upon entering a room", "Auto browse to all secrets in the room", "secret.secretpathfind.allbrowse", false); + addParameter("bat", new FeatureParameter<Boolean>("bat", "Trigger pathfind to Bat", "This feature will trigger pathfind to all bats in this room when entering a room", true, "boolean")); + addParameter("chest", new FeatureParameter<Boolean>("chest", "Trigger pathfind to Chest", "This feature will trigger pathfind to all chests in this room when entering a room", true, "boolean")); + addParameter("essence", new FeatureParameter<Boolean>("essence", "Trigger pathfind to Essence", "This feature will trigger pathfind to all essences in this room when entering a room", true, "boolean")); + addParameter("itemdrop", new FeatureParameter<Boolean>("itemdrop", "Trigger pathfind to Itemdrop", "This feature will trigger pathfind to all itemdrops in this room when entering a room", true, "boolean")); } public boolean isBat() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java index 0c3ae9e6..7394e73d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java @@ -16,31 +16,32 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.listener.TickListener; -import kr.syeyoung.dungeonsguide.features.text.*; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; -import kr.syeyoung.dungeonsguide.gui.elements.MPassiveLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MStringSelectionButton; -import kr.syeyoung.dungeonsguide.gui.elements.MToggleButton; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonFairySoul; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoomInfoRegistry; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.listener.TickListener; +import kr.syeyoung.dungeonsguide.mod.features.text.*; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MPassiveLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MStringSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MToggleButton; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; @@ -57,10 +58,10 @@ import java.util.function.Predicate; public class FeatureSoulRoomWarning extends TextHUDFeature implements TickListener { public FeatureSoulRoomWarning() { - super("Dungeon.Dungeon Information","Secret Soul Alert", "Alert if there is an fairy soul in the room", "secret.fairysoulwarn", true, getFontRenderer().getStringWidth("There is a fairy soul in this room!"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.HUDs","Secret Soul Alert", "Alert if there is an fairy soul in the room", "secret.fairysoulwarn", true, getFontRenderer().getStringWidth("There is a fairy soul in this room!"), getFontRenderer().FONT_HEIGHT); getStyles().add(new TextStyle("warning", new AColor(0xFF, 0x69,0x17,255), new AColor(0, 0,0,0), false)); - this.parameters.put("roomuids", new FeatureParameter("roomuids", "Disabled room Names", "Disable for these rooms", new ArrayList<>(), "stringlist")); + addParameter("roomuids", new FeatureParameter("roomuids", "Disabled room Names", "Disable for these rooms", new ArrayList<>(), "stringlist")); } SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @@ -91,8 +92,8 @@ public class FeatureSoulRoomWarning extends TextHUDFeature implements TickListen @Override public void onTick() { if (!skyblockStatus.isOnDungeon()) return; - if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) return; - DungeonContext context = skyblockStatus.getContext(); + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null || !DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getMapProcessor().isInitialized()) return; + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; if (thePlayer == null) return; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureTogglePathfind.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureTogglePathfind.java index aa128d92..e55d7e00 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureTogglePathfind.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureTogglePathfind.java @@ -16,30 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; -import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.Keybinds; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.features.listener.KeybindPressedListener; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MKeyEditButton; -import lombok.Getter; -import net.minecraft.client.Minecraft; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.KeybindPressedListener; import net.minecraft.util.ChatComponentText; import org.lwjgl.input.Keyboard; public class FeatureTogglePathfind extends SimpleFeature implements KeybindPressedListener { public FeatureTogglePathfind() { - super("Dungeon Secrets.Keybinds", "Toggle Pathfind Lines", "A key for toggling pathfound line visibility.\nPress settings to edit the key", "secret.togglePathfind"); - this.parameters.put("key", new FeatureParameter<Integer>("key", "Key", "Press to toggle pathfind lines", Keyboard.KEY_NONE, "keybind")); + super("Dungeon.Secrets.Keybinds", "Toggle Pathfind Lines", "A key for toggling pathfound line visibility.\nPress settings to edit the key", "secret.togglePathfind"); + addParameter("key", new FeatureParameter<Integer>("key", "Key", "Press to toggle pathfind lines", Keyboard.KEY_NONE, "keybind")); } public boolean togglePathfindStatus = false; @@ -48,7 +38,7 @@ public class FeatureTogglePathfind extends SimpleFeature implements KeybindPress if (keyBindPressedEvent.getKey() == this.<Integer>getParameter("key").getValue() && isEnabled()) { togglePathfindStatus = !togglePathfindStatus; try { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fToggled Pathfind Line visibility to §e"+(togglePathfindStatus ? "on":"off"))); + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §fToggled Pathfind Line visibility to §e"+(togglePathfindStatus ? "on":"off"))); } catch (Exception ignored) {} } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java index c5f388db..f5137394 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java @@ -16,20 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret; import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; -import kr.syeyoung.dungeonsguide.features.AbstractFeature; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import java.util.LinkedHashMap; @@ -40,14 +38,14 @@ public class PathfindLineProperties extends SimpleFeature { this.parent = parent; this.parameters = new LinkedHashMap<>(); if (parent != null) - this.parameters.put("useGlobal", new FeatureParameter<Boolean>("useGlobal", "Use Global Settings instead of this", "Completely ignore these settings, then use the parent one:: '"+parent.getName()+"'", useParent, "boolean")); - this.parameters.put("pathfind", new FeatureParameter<Boolean>("pathfind", "Enable Pathfinding", "Enable pathfind for secrets", useParent, "boolean")); - this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the pathfind line", new AColor(0xFFFF0000, true), "acolor")); - this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the pathfind line",1.0f, "float")); - this.parameters.put("linerefreshrate", new FeatureParameter<Integer>("linerefreshrate", "Line Refreshrate", "Ticks to wait per line refresh. Specify it to -1 to don't refresh line at all", 10, "integer")); - this.parameters.put("beacon", new FeatureParameter<Boolean>("beacon", "Enable Beacons", "Enable beacons for pathfind line targets", true, "boolean")); - this.parameters.put("beamColor", new FeatureParameter<AColor>("beamColor", "Beam Color", "Color of the beacon beam", new AColor(0x77FF0000, true), "acolor")); - this.parameters.put("beamTargetColor", new FeatureParameter<AColor>("beamTargetColor", "Target Color", "Color of the target", new AColor(0x33FF0000, true), "acolor")); + addParameter("useGlobal", new FeatureParameter<Boolean>("useGlobal", "Use Global Settings instead of this", "Completely ignore these settings, then use the parent one:: '"+parent.getName()+"'", useParent, "boolean")); + addParameter("pathfind", new FeatureParameter<Boolean>("pathfind", "Enable Pathfinding", "Enable pathfind for secrets", useParent, "boolean")); + addParameter("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the pathfind line", new AColor(0xFFFF0000, true), "acolor")); + addParameter("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the pathfind line",1.0f, "float")); + addParameter("linerefreshrate", new FeatureParameter<Integer>("linerefreshrate", "Line Refreshrate", "Ticks to wait per line refresh. Specify it to -1 to don't refresh line at all", 10, "integer")); + addParameter("beacon", new FeatureParameter<Boolean>("beacon", "Enable Beacons", "Enable beacons for pathfind line targets", true, "boolean")); + addParameter("beamColor", new FeatureParameter<AColor>("beamColor", "Beam Color", "Color of the beacon beam", new AColor(0x77FF0000, true), "acolor")); + addParameter("beamTargetColor", new FeatureParameter<AColor>("beamTargetColor", "Target Color", "Color of the target", new AColor(0x33FF0000, true), "acolor")); } @@ -103,8 +101,8 @@ public class PathfindLineProperties extends SimpleFeature { public AColor getTargetColor() { return isGlobal() ? parent.getTargetColor() : this.<AColor>getParameter("beamTargetColor").getValue(); } - public ActionRoute.ActionRouteProperties getRouteProperties() { - ActionRoute.ActionRouteProperties actionRouteProperties = new ActionRoute.ActionRouteProperties(); + public ActionRouteProperties getRouteProperties() { + ActionRouteProperties actionRouteProperties = new ActionRouteProperties(); actionRouteProperties.setPathfind(isPathfind()); actionRouteProperties.setLineColor(getLineColor()); actionRouteProperties.setLineWidth(getLineWidth()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java index 6a00b72b..76f64d08 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java @@ -16,42 +16,27 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser; - -import com.google.common.collect.Lists; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.SkyblockStatus; -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.config.types.GUIRectangle; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser.MGuiMechanicBrowser; -import kr.syeyoung.dungeonsguide.features.listener.GuiClickListener; -import kr.syeyoung.dungeonsguide.features.listener.GuiPreRenderListener; -import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; -import kr.syeyoung.dungeonsguide.features.text.StyledTextRenderer; -import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MFloatSelectionButton; -import kr.syeyoung.dungeonsguide.gui.elements.MPassiveLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MStringSelectionButton; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonParameterEdit; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonValueEdit; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.utils.GlStateUtils; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser; + +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.config.types.GUIRectangle; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiClickListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.GuiPreRenderListener; +import kr.syeyoung.dungeonsguide.mod.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MFloatSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MPassiveLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.*; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.util.MathHelper; import net.minecraftforge.client.event.GuiScreenEvent; import org.lwjgl.input.Mouse; @@ -65,8 +50,8 @@ import java.util.List; public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderListener, GuiClickListener, WorldRenderListener { public FeatureMechanicBrowse() { - super("Dungeon Secrets.Secret Browser","Secret Browser", "Browse and Pathfind secrets and mechanics in the current room", "secret.mechanicbrowse", false, 100, 300); - parameters.put("scale", new FeatureParameter<Float>("scale", "Scale", "Scale", 1.0f, "float")); + super("Dungeon.Secrets.Secret Browser","Secret Browser", "Browse and Pathfind secrets and mechanics in the current room", "secret.mechanicbrowse", false, 100, 300); + addParameter("scale", new FeatureParameter<Float>("scale", "Scale", "Scale", 1.0f, "float")); mGuiMechanicBrowser = new MGuiMechanicBrowser(this); mGuiMechanicBrowser.setWorldAndResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); lastWidth = Minecraft.getMinecraft().displayWidth; lastHeight = Minecraft.getMinecraft().displayHeight; @@ -144,8 +129,8 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis if (!isEnabled()) return; SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); if (!skyblockStatus.isOnDungeon()) return; - if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) return; - DungeonContext context = skyblockStatus.getContext(); + if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null || !DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getMapProcessor().isInitialized()) return; + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java index 27d5e583..d7d69e0a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser; -import kr.syeyoung.dungeonsguide.gui.MGui; +import kr.syeyoung.dungeonsguide.mod.gui.MGui; import lombok.Getter; public class MGuiMechanicBrowser extends MGui { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MechanicBrowserElement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MechanicBrowserElement.java index ca803bff..03937077 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MechanicBrowserElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MechanicBrowserElement.java @@ -16,20 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.GlStateUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.AllArgsConstructor; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.GlStateManager; -import org.lwjgl.opengl.GL11; import java.awt.*; import java.util.function.BiConsumer; -import java.util.function.Consumer; import java.util.function.Supplier; @AllArgsConstructor diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MechanicBrowserTooltip.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MechanicBrowserTooltip.java index e2a0d028..87b100a5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MechanicBrowserTooltip.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/MechanicBrowserTooltip.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser; -import kr.syeyoung.dungeonsguide.gui.elements.MList; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MList; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltip; import lombok.Getter; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java index 25b23e71..e9082ab8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java @@ -16,19 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser; +package kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; -import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute; +import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRoute; import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; -import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MList; -import kr.syeyoung.dungeonsguide.gui.elements.MPanelScaledGUI; -import kr.syeyoung.dungeonsguide.gui.elements.MScrollablePanel; -import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MList; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MPanelScaledGUI; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MScrollablePanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -72,9 +73,16 @@ public class PanelMechanicBrowser extends MPanelScaledGUI { public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { toggleTooltip(openGUI()); - Optional<DungeonRoom> dungeonRoomOpt = Optional.ofNullable(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext()) + if(Minecraft.getMinecraft().thePlayer == null) return; + + + Optional<DungeonRoom> dungeonRoomOpt = Optional.ofNullable(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext()) .map(DungeonContext::getMapProcessor).map(a->a.worldPointToRoomPoint(Minecraft.getMinecraft().thePlayer.getPosition())) - .map(a -> DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext().getRoomMapper().get(a)); + .map(a -> { + + return DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getRoomMapper().get(a); + }); + DungeonRoom dungeonRoom = dungeonRoomOpt.orElse(null); renderTick(dungeonRoom); @@ -235,9 +243,13 @@ public class PanelMechanicBrowser extends MPanelScaledGUI { @Getter private String selectedID = null; public void onElementClick(String id, DungeonMechanic dungeonMechanic, Point pt, MechanicBrowserElement mechanicBrowserElement) { - Optional<DungeonRoom> dungeonRoomOpt = Optional.ofNullable(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext()) + + Optional<DungeonRoom> dungeonRoomOpt = Optional.ofNullable(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext()) .map(DungeonContext::getMapProcessor).map(a->a.worldPointToRoomPoint(Minecraft.getMinecraft().thePlayer.getPosition())) - .map(a -> DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext().getRoomMapper().get(a)); + .map(a -> { + + return DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getRoomMapper().get(a); + }); selectedID = id; DungeonRoom dungeonRoom = dungeonRoomOpt.orElse(null); @@ -270,9 +282,13 @@ public class PanelMechanicBrowser extends MPanelScaledGUI { } public void cancel(MechanicBrowserElement mechanicBrowserElement) { - Optional<DungeonRoom> dungeonRoomOpt = Optional.ofNullable(DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext()) + + Optional<DungeonRoom> dungeonRoomOpt = Optional.ofNullable(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext()) .map(DungeonContext::getMapProcessor).map(a->a.worldPointToRoomPoint(Minecraft.getMinecraft().thePlayer.getPosition())) - .map(a -> DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext().getRoomMapper().get(a)); + .map(a -> { + + return DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getRoomMapper().get(a); + }); mechanicBrowserElement.setFocused(false); if (!dungeonRoomOpt.isPresent()) return; DungeonRoom dungeonRoom = dungeonRoomOpt.get(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBlaze.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBlaze.java new file mode 100644 index 00000000..b755b94b --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBlaze.java @@ -0,0 +1,51 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; + +public class FeatureSolverBlaze extends SimpleFeature { + public FeatureSolverBlaze() { + super("Dungeon.Solvers.Floor 2+", "Blaze", "Highlights the blaze that needs to be killed in an blaze room", "solver.blaze"); + addParameter("normBlazeColor", new FeatureParameter<AColor>("blazecolor", "Normal Blaze Color", "Normal Blaze Color", new AColor(255,255,255,255), "acolor", nval -> normBlazeColor = nval)); + addParameter("nextBlazeColor", new FeatureParameter<AColor>("blazecolor", "Next Blaze Color", "Next Blaze Color", new AColor(0,255,0,255), "acolor", nval -> nextBlazeColor = nval)); + addParameter("nextUpBlazeColor", new FeatureParameter<AColor>("blazecolor", "Next Up Blaze Color", "Color of blaze after next blaze", new AColor(255,255,0,255), "acolor", nval -> nextUpBlazeColor = nval)); + addParameter("blazeborder", new FeatureParameter<AColor>("blazeborder", "Blaze Border Color", "Blaze border color", new AColor(255,255,255,0), "acolor", nval -> blazeborder = nval)); + } + + AColor normBlazeColor; + AColor nextBlazeColor; + AColor nextUpBlazeColor; + AColor blazeborder; + + public AColor getBlazeColor() { + return normBlazeColor; + } + public AColor getNextBlazeColor() { + return nextBlazeColor; + } + public AColor getNextUpBlazeColor() { + return nextUpBlazeColor; + } + public AColor getBorder() { + return blazeborder; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBombdefuse.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBombdefuse.java index e9bf623b..1eb2c930 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBombdefuse.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBombdefuse.java @@ -16,15 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; import org.lwjgl.input.Keyboard; public class FeatureSolverBombdefuse extends SimpleFeature { public FeatureSolverBombdefuse() { - super("Solver.Floor 7+", "Bomb Defuse", "Communicates with others dg using key 'F' for solutions and displays it", "solver.bombdefuse"); - parameters.put("key", new FeatureParameter<Integer>("key", "Key","Press to send solution in chat", Keyboard.KEY_NONE, "keybind")); + super("Dungeon.Solvers.Floor 7+", "Bomb Defuse", "Communicates with others dg using key 'F' for solutions and displays it", "solver.bombdefuse"); + addParameter("key", new FeatureParameter<Integer>("key", "Key","Press to send solution in chat", Keyboard.KEY_NONE, "keybind")); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBox.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java index c4dcebf6..0c00add5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBox.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java @@ -16,25 +16,25 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; import java.util.LinkedHashMap; public class FeatureSolverBox extends SimpleFeature { public FeatureSolverBox() { - super("Solver.Floor 3+", "Box (Advanced)", "Calculates solution for box puzzle room, and displays it to user", "solver.box"); + super("Dungeon.Solvers.Floor 3+", "Box (Advanced)", "Calculates solution for box puzzle room, and displays it to user", "solver.box"); this.parameters = new LinkedHashMap<>(); - this.parameters.put("disableText", new FeatureParameter<Boolean>("disableText", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", false, "boolean")); - this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); - this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); + addParameter("disableText", new FeatureParameter<Boolean>("disableText", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", false, "boolean")); + addParameter("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); + addParameter("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); - this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the target button", new AColor(0x5500FFFF, true), "acolor")); - this.parameters.put("textColor1", new FeatureParameter<AColor>("textColor1", "Text Color", "Color of the text (next step)", new AColor(0xFF00FF00, true), "acolor")); - this.parameters.put("textColor2", new FeatureParameter<AColor>("textColor2", "Text Color", "Color of the text (others)", new AColor(0xFF000000, true), "acolor")); + addParameter("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the target button", new AColor(0x5500FFFF, true), "acolor")); + addParameter("textColor1", new FeatureParameter<AColor>("textColor1", "Text Color", "Color of the text (next step)", new AColor(0xFF00FF00, true), "acolor")); + addParameter("textColor2", new FeatureParameter<AColor>("textColor2", "Text Color", "Color of the text (others)", new AColor(0xFF000000, true), "acolor")); } public AColor getLineColor() { return this.<AColor>getParameter("lineColor").getValue(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverIcefill.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java index 681e6b12..b21a9098 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverIcefill.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java @@ -16,20 +16,20 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; import java.util.LinkedHashMap; public class FeatureSolverIcefill extends SimpleFeature { public FeatureSolverIcefill() { - super("Solver.Floor 3+", "Icepath (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath"); + super("Dungeon.Solvers.Floor 3+", "Icepath (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath"); this.parameters = new LinkedHashMap<>(); - this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); - this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); + addParameter("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); + addParameter("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); } public AColor getLineColor() { return this.<AColor>getParameter("lineColor").getValue(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverKahoot.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverKahoot.java index 6055c12b..fdd1ed7c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverKahoot.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverKahoot.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureSolverKahoot extends SimpleFeature { public FeatureSolverKahoot() { - super("Solver.Floor 4+", "Quiz", "Highlights the correct solution for trivia puzzle", "solver.trivia"); + super("Dungeon.Solvers.Floor 4+", "Quiz", "Highlights the correct solution for trivia puzzle", "solver.trivia"); - this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box", new AColor(0,255,0,50), "acolor")); + addParameter("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box", new AColor(0,255,0,50), "acolor")); } public AColor getTargetColor() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverRiddle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverRiddle.java index 23bc5a0c..da84f379 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverRiddle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverRiddle.java @@ -16,17 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureSolverRiddle extends SimpleFeature { public FeatureSolverRiddle() { - super("Solver.Any Floor", "Riddle", "Highlights the correct box after clicking on all 3 weirdos", "solver.riddle"); + super("Dungeon.Solvers.Any Floor", "Riddle", "Highlights the correct box after clicking on all 3 weirdos", "solver.riddle"); - this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box", new AColor(0,255,0,50), "acolor")); + addParameter("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box", new AColor(0,255,0,50), "acolor")); } public AColor getTargetColor() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverSilverfish.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java index 31a4d0e6..a014b09e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverSilverfish.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java @@ -16,25 +16,29 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; import java.util.LinkedHashMap; public class FeatureSolverSilverfish extends SimpleFeature { public FeatureSolverSilverfish() { - super("Solver.Floor 3+", "Silverfish (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish"); + super("Dungeon.Solvers.Floor 3+", "Silverfish (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish"); this.parameters = new LinkedHashMap<>(); - this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); - this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); + addParameter("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor", nval -> lineColor = nval)); + addParameter("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float", nval -> lineWidth = nval)); } + + AColor lineColor; + Float lineWidth; + public AColor getLineColor() { - return this.<AColor>getParameter("lineColor").getValue(); + return lineColor; } public float getLineWidth() { - return this.<Float>getParameter("lineWidth").getValue(); + return lineWidth; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTeleport.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverTeleport.java index c7e42516..f2a6adf2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTeleport.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverTeleport.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureSolverTeleport extends SimpleFeature { public FeatureSolverTeleport() { - super("Solver.Any Floor", "Teleport", "Shows teleport pads you've visited in a teleport maze room", "solver.teleport"); + super("Dungeon.Solvers.Any Floor", "Teleport", "Shows teleport pads you've visited in a teleport maze room", "solver.teleport"); - this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Solution Color", "Color of the solution teleport pad", new AColor(0,255,0,100), "acolor")); - this.parameters.put("targetColor2", new FeatureParameter<AColor>("targetColor2", "Not-Solution Color", "Color of the solution teleport pads you've been to", new AColor(255,0,0,100), "acolor")); + addParameter("targetColor", new FeatureParameter<AColor>("targetColor", "Solution Color", "Color of the solution teleport pad", new AColor(0,255,0,100), "acolor")); + addParameter("targetColor2", new FeatureParameter<AColor>("targetColor2", "Not-Solution Color", "Color of the solution teleport pads you've been to", new AColor(255,0,0,100), "acolor")); } public AColor getTargetColor() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTictactoe.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverTictactoe.java index 68ca4cb5..cafe97b3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTictactoe.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverTictactoe.java @@ -16,18 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.impl.solvers; +package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; public class FeatureSolverTictactoe extends SimpleFeature { public FeatureSolverTictactoe() { - super("Solver.Any Floor", "Tictactoe", "Shows the best move that could be taken by player in the tictactoe room", "solver.tictactoe"); + super("Dungeon.Solvers.Any Floor", "Tictactoe", "Shows the best move that could be taken by player in the tictactoe room", "solver.tictactoe"); - this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box during your turn", new AColor(0,255,255,50), "acolor")); - this.parameters.put("targetColor2", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box during enemy turn", new AColor(255,201,0,50), "acolor")); + addParameter("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box during your turn", new AColor(0,255,255,50), "acolor")); + addParameter("targetColor2", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box during enemy turn", new AColor(255,201,0,50), "acolor")); } public AColor getTargetColor() { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/BossroomEnterListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/BossroomEnterListener.java index aa0b6686..5de1e891 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/BossroomEnterListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/BossroomEnterListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface BossroomEnterListener { void onBossroomEnter(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/ChatListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ChatListener.java index 4bd7e9ef..fae18924 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/ChatListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ChatListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.ClientChatReceivedEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/ChatListenerGlobal.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ChatListenerGlobal.java index 631f4cda..60eed29b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/ChatListenerGlobal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ChatListenerGlobal.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.ClientChatReceivedEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DiscordUserJoinRequestListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DiscordUserJoinRequestListener.java index d48331d5..44656aa1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DiscordUserJoinRequestListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DiscordUserJoinRequestListener.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import kr.syeyoung.dungeonsguide.events.DiscordUserJoinRequestEvent; -import kr.syeyoung.dungeonsguide.events.DiscordUserUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.DiscordUserJoinRequestEvent; public interface DiscordUserJoinRequestListener { void onDiscordUserJoinRequest(DiscordUserJoinRequestEvent event); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DiscordUserUpdateListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DiscordUserUpdateListener.java index d376a21d..2404d960 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DiscordUserUpdateListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DiscordUserUpdateListener.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import kr.syeyoung.dungeonsguide.events.DiscordUserUpdateEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.DiscordUserUpdateEvent; public interface DiscordUserUpdateListener { void onDiscordUserUpdate(DiscordUserUpdateEvent event); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonContextInitializationListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonContextInitializationListener.java index 6256b190..a234fa61 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonContextInitializationListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonContextInitializationListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface DungeonContextInitializationListener { void onDungeonInitialize(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonEndListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonEndListener.java index 4b77f584..c9ca0caa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonEndListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonEndListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface DungeonEndListener { void onDungeonEnd(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonQuitListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonQuitListener.java index a576ac53..fc0e114f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonQuitListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonQuitListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface DungeonQuitListener { void onDungeonQuit(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonStartListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonStartListener.java index 7edcff0d..d0674daf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/DungeonStartListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/DungeonStartListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface DungeonStartListener { void onDungeonStart(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/EntityLivingRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/EntityLivingRenderListener.java index 44207678..f13c29f0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/EntityLivingRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/EntityLivingRenderListener.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.RenderLivingEvent; -import net.minecraftforge.client.event.RenderPlayerEvent; public interface EntityLivingRenderListener { void onEntityRenderPre(RenderLivingEvent.Pre renderPlayerEvent); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiBackgroundRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiBackgroundRenderListener.java index b46f9353..abaf900c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiBackgroundRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiBackgroundRenderListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.GuiScreenEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiClickListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiClickListener.java index 048c9683..d3816c3e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiClickListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiClickListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.GuiScreenEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiOpenListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiOpenListener.java index 0ce74ae9..bb8b8348 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiOpenListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiOpenListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.GuiOpenEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiPostRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiPostRenderListener.java index 6ea30768..2cd249f5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiPostRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiPostRenderListener.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.GuiScreenEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent; public interface GuiPostRenderListener { void onGuiPostRender(GuiScreenEvent.DrawScreenEvent.Post rendered); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiPreRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiPreRenderListener.java index e902f41d..848267c3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiPreRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiPreRenderListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.GuiScreenEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiUpdateListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiUpdateListener.java index a52baac7..633f1542 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/GuiUpdateListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/GuiUpdateListener.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import kr.syeyoung.dungeonsguide.events.WindowUpdateEvent; -import net.minecraftforge.client.event.GuiScreenEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.WindowUpdateEvent; public interface GuiUpdateListener { void onGuiUpdate(WindowUpdateEvent windowUpdateEvent); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/InteractListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/InteractListener.java index 717f2c72..0dcbc19d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/InteractListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/InteractListener.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; public interface InteractListener { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/KeyInputListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/KeyInputListener.java index ae940936..bba7862b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/KeyInputListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/KeyInputListener.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.GuiScreenEvent; -import net.minecraftforge.fml.common.gameevent.InputEvent; public interface KeyInputListener { void onKeyInput(GuiScreenEvent.KeyboardInputEvent keyboardInputEvent); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/KeybindPressedListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/KeybindPressedListener.java index 3d67e326..d0966183 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/KeybindPressedListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/KeybindPressedListener.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import kr.syeyoung.dungeonsguide.events.KeyBindPressedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.KeyBindPressedEvent; public interface KeybindPressedListener { void onKeybindPress(KeyBindPressedEvent keyBindPressedEvent); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/PlayerRenderListener.java index 73a27171..40961ced 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/PlayerRenderListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.RenderPlayerEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/ScreenRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ScreenRenderListener.java index d801e7ea..4a69b8eb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/ScreenRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/ScreenRenderListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface ScreenRenderListener { void drawScreen(float partialTicks); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/SkyblockJoinListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SkyblockJoinListener.java index bd27a83b..d2d996e9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/SkyblockJoinListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SkyblockJoinListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface SkyblockJoinListener { void onSkyblockJoin(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/SkyblockLeaveListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SkyblockLeaveListener.java index efa80789..e1d95775 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/SkyblockLeaveListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SkyblockLeaveListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface SkyblockLeaveListener { void onSkyblockQuit(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/SoundListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SoundListener.java index 8bdbf532..9cd4b2fe 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/SoundListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/SoundListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.client.event.sound.PlaySoundEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/StompConnectedListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/StompConnectedListener.java index 0f5bad0e..3772f780 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/StompConnectedListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/StompConnectedListener.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.StompConnectedEvent; public interface StompConnectedListener { void onStompConnected(StompConnectedEvent event); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TextureStichListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TextureStichListener.java index 77600d1e..5c54eb9e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TextureStichListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TextureStichListener.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; -import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.client.event.TextureStitchEvent; public interface TextureStichListener { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TickListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TickListener.java index 2fea2f09..436ea23d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TickListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TickListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface TickListener { void onTick(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TitleListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TitleListener.java index 806cd50b..ec402a96 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TitleListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TitleListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraft.network.play.server.S45PacketTitle; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TooltipListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TooltipListener.java index f1363dc2..f2f73c62 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/TooltipListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/TooltipListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; import net.minecraftforge.event.entity.player.ItemTooltipEvent; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/WorldRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/WorldRenderListener.java index c4b68c52..40b8e338 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/WorldRenderListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/listener/WorldRenderListener.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.listener; +package kr.syeyoung.dungeonsguide.mod.features.listener; public interface WorldRenderListener { void drawWorld(float partialTicks); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/PanelTextParameterConfig.java index beeff007..f12fb379 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/PanelTextParameterConfig.java @@ -16,19 +16,18 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.text; - -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MEditableAColor; -import kr.syeyoung.dungeonsguide.gui.elements.MPanelScaledGUI; -import kr.syeyoung.dungeonsguide.gui.elements.MScrollablePanel; -import kr.syeyoung.dungeonsguide.gui.elements.MToggleButton; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +package kr.syeyoung.dungeonsguide.mod.features.text; + +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MEditableAColor; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MPanelScaledGUI; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MScrollablePanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MToggleButton; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledText.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledText.java index 10f9b06d..d9f936fa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledText.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledText.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.text; +package kr.syeyoung.dungeonsguide.mod.features.text; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledTextProvider.java index f3eba3a9..04a4cc81 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextProvider.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledTextProvider.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.text; +package kr.syeyoung.dungeonsguide.mod.features.text; import java.util.List; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledTextRenderer.java index 9ebc138b..17bddb72 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/StyledTextRenderer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/StyledTextRenderer.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.text; +package kr.syeyoung.dungeonsguide.mod.features.text; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.client.Minecraft; @@ -27,7 +27,6 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; import java.awt.*; import java.lang.reflect.Field; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java index b0cda000..f70ab496 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java @@ -16,22 +16,22 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.text; +package kr.syeyoung.dungeonsguide.mod.features.text; import com.google.common.base.Supplier; import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; -import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit; -import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel; -import kr.syeyoung.dungeonsguide.config.guiconfig.location.GuiGuiLocationConfig; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.features.GuiFeature; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MFloatSelectionButton; -import kr.syeyoung.dungeonsguide.gui.elements.MPassiveLabelAndElement; -import kr.syeyoung.dungeonsguide.gui.elements.MStringSelectionButton; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MFeatureEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.MParameterEdit; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.RootConfigPanel; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.GuiFeature; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MFloatSelectionButton; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MPassiveLabelAndElement; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MStringSelectionButton; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; @@ -41,9 +41,9 @@ import java.util.List; public abstract class TextHUDFeature extends GuiFeature implements StyledTextProvider { protected TextHUDFeature(String category, String name, String description, String key, boolean keepRatio, int width, int height) { super(category, name, description, key, keepRatio, width, height); - this.parameters.put("textStylesNEW", new FeatureParameter<List<TextStyle>>("textStylesNEW", "", "", new ArrayList<TextStyle>(), "list_textStyle")); - this.parameters.put("alignment", new FeatureParameter<String>("alignment", "Alignment", "Alignment", "LEFT", "string")); - this.parameters.put("scale", new FeatureParameter<Float>("scale", "Scale", "Scale", 1.0f, "float")); + addParameter("textStylesNEW", new FeatureParameter<List<TextStyle>>("textStylesNEW", "", "", new ArrayList<TextStyle>(), "list_textStyle")); + addParameter("alignment", new FeatureParameter<String>("alignment", "Alignment", "Alignment", "LEFT", "string")); + addParameter("scale", new FeatureParameter<Float>("scale", "Scale", "Scale", 1.0f, "float")); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java index 7af96457..16cb4b66 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java @@ -16,15 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.features.text; +package kr.syeyoung.dungeonsguide.mod.features.text; -import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import java.awt.*; - @Data @AllArgsConstructor @NoArgsConstructor diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/MGui.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/MGui.java index 13c9e00f..1db826a4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/MGui.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/MGui.java @@ -16,17 +16,16 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui; +package kr.syeyoung.dungeonsguide.mod.gui; -import kr.syeyoung.dungeonsguide.gui.elements.MRootPanel; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; -import kr.syeyoung.dungeonsguide.utils.cursor.GLCursors; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MRootPanel; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.GLCursors; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.Tuple; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -34,8 +33,6 @@ import org.lwjgl.opengl.GL11; import java.awt.*; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; public class MGui extends GuiScreen { @@ -43,7 +40,7 @@ public class MGui extends GuiScreen { private final MRootPanel mainPanel = new MRootPanel(); private boolean isOpen = false; - public MGui(){ + public MGui() { try { Mouse.setNativeCursor(GLCursors.getCursor(EnumCursor.DEFAULT)); } catch (Throwable e) { @@ -57,30 +54,25 @@ public class MGui extends GuiScreen { Keyboard.enableRepeatEvents(true); isOpen = true; ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - mainPanel.setBounds(new Rectangle(0,0,Minecraft.getMinecraft().displayWidth,Minecraft.getMinecraft().displayHeight)); + mainPanel.setBounds(new Rectangle(0, 0, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight)); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { - try { - - int i = Mouse.getEventX(); - int j = this.mc.displayHeight - Mouse.getEventY(); - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - GlStateManager.pushMatrix(); - GlStateManager.disableDepth(); - GlStateManager.enableBlend(); - GlStateManager.enableAlpha(); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); - GlStateManager.color(1, 1, 1, 1); - GlStateManager.scale(1.0/scaledResolution.getScaleFactor(), 1.0/scaledResolution.getScaleFactor(), 1.0d); - mainPanel.render0(1, new Point(0,0), new Rectangle(0,0,Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight), i, j, i, j, partialTicks); - GlStateManager.popMatrix(); - GlStateManager.enableBlend(); - GlStateManager.enableDepth(); - } catch (Throwable e) { - e.printStackTrace(); - } + int i = Mouse.getEventX(); + int j = this.mc.displayHeight - Mouse.getEventY(); + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + GlStateManager.pushMatrix(); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.color(1, 1, 1, 1); + GlStateManager.scale(1.0 / scaledResolution.getScaleFactor(), 1.0 / scaledResolution.getScaleFactor(), 1.0d); + mainPanel.render0(1, new Point(0, 0), new Rectangle(0, 0, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight), i, j, i, j, partialTicks); + GlStateManager.popMatrix(); + GlStateManager.enableBlend(); + GlStateManager.enableDepth(); GL11.glDisable(GL11.GL_SCISSOR_TEST); } @@ -94,6 +86,7 @@ public class MGui extends GuiScreen { e.printStackTrace(); } } + public void keyHeld(int keyCode, char typedChar) throws IOException { try { mainPanel.keyHeld0(typedChar, keyCode); @@ -102,6 +95,7 @@ public class MGui extends GuiScreen { e.printStackTrace(); } } + public void keyReleased(int keyCode, char typedChar) throws IOException { try { mainPanel.keyReleased0(typedChar, keyCode); @@ -116,10 +110,10 @@ public class MGui extends GuiScreen { try { super.mouseClicked(mouseX, mouseY, mouseButton); mainPanel.mouseClicked0(mouseX, mouseY - ,mouseX, mouseY, mouseButton); + , mouseX, mouseY, mouseButton); } catch (Throwable e) { if (e.getMessage() == null || !e.getMessage().contains("hack to stop")) - e.printStackTrace(); + e.printStackTrace(); } } @@ -141,10 +135,10 @@ public class MGui extends GuiScreen { public void mouseReleased(int mouseX, int mouseY, int state) { try { mainPanel.mouseReleased0(mouseX, mouseY - ,mouseX,mouseY , state); + , mouseX, mouseY, state); } catch (Throwable e) { if (e.getMessage() == null || !e.getMessage().contains("hack to stop")) - e.printStackTrace(); + e.printStackTrace(); } } @@ -152,17 +146,17 @@ public class MGui extends GuiScreen { public void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { try { mainPanel.mouseClickMove0(mouseX, mouseY - ,mouseX ,mouseY, clickedMouseButton, timeSinceLastClick); + , mouseX, mouseY, clickedMouseButton, timeSinceLastClick); } catch (Throwable e) { if (e.getMessage() == null || !e.getMessage().contains("hack to stop")) - e.printStackTrace(); + e.printStackTrace(); } } public void mouseMove(int mouseX, int mouseY) { try { mainPanel.mouseMoved0(mouseX, mouseY - ,mouseX ,mouseY); + , mouseX, mouseY); } catch (Throwable e) { if (e.getMessage() == null || !e.getMessage().contains("hack to stop")) e.printStackTrace(); @@ -186,29 +180,22 @@ public class MGui extends GuiScreen { int j = this.mc.displayHeight - Mouse.getEventY(); int k = Mouse.getEventButton(); - if (Mouse.getEventButtonState()) - { - if (this.mc.gameSettings.touchscreen && this.touchValue++ > 0) - { + if (Mouse.getEventButtonState()) { + if (this.mc.gameSettings.touchscreen && this.touchValue++ > 0) { return; } this.eventButton = k; this.lastMouseEvent = Minecraft.getSystemTime(); this.mouseClicked(i, j, this.eventButton); - } - else if (k != -1) - { - if (this.mc.gameSettings.touchscreen && --this.touchValue > 0) - { + } else if (k != -1) { + if (this.mc.gameSettings.touchscreen && --this.touchValue > 0) { return; } this.eventButton = -1; this.mouseReleased(i, j, k); - } - else if (this.eventButton != -1 && this.lastMouseEvent > 0L) - { + } else if (this.eventButton != -1 && this.lastMouseEvent > 0L) { long l = Minecraft.getSystemTime() - this.lastMouseEvent; this.mouseClickMove(i, j, this.eventButton, l); } @@ -228,20 +215,19 @@ public class MGui extends GuiScreen { int wheel = Mouse.getEventDWheel(); if (wheel != 0) { - mainPanel.mouseScrolled0(i, j,i,j, wheel); + mainPanel.mouseScrolled0(i, j, i, j, wheel); } lastX = i; lastY = j; } catch (Throwable e) { - e.printStackTrace(); + e.printStackTrace(); } } - public void handleKeyboardInput() throws IOException - { + + public void handleKeyboardInput() throws IOException { if (!isOpen) return; - if (Keyboard.getEventKeyState()) - { + if (Keyboard.getEventKeyState()) { if (Keyboard.isRepeatEvent()) this.keyHeld(Keyboard.getEventKey(), Keyboard.getEventCharacter()); else diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/MPanel.java index b79ec148..6a329110 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/MPanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/MPanel.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui; +package kr.syeyoung.dungeonsguide.mod.gui; -import kr.syeyoung.dungeonsguide.gui.elements.MTooltip; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltip; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MButton.java index 1e9bcd0a..4d8ee52f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MButton.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MCollapsable.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MCollapsable.java index 5a0dd4ba..f665ee15 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MCollapsable.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MCollapsable.java @@ -16,15 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MColor.java index de1f44a4..d7cccdc6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MColor.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MEditableAColor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MEditableAColor.java index 888d1e03..b33a2b48 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MEditableAColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MEditableAColor.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -44,7 +44,6 @@ public class MEditableAColor extends MPanel { private Dimension size = new Dimension(20,15); @Getter - @Setter private boolean enableEdit = false; @Getter diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MFloatSelectionButton.java index 99d7b322..1bda009c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MFloatSelectionButton.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MIntegerSelectionButton.java index a80b0e7a..6d17aebf 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MIntegerSelectionButton.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import org.lwjgl.input.Keyboard; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MKeyEditButton.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MKeyEditButton.java index f02a041b..70330f03 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MKeyEditButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MKeyEditButton.java @@ -16,11 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; @@ -29,7 +29,6 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.settings.GameSettings; -import net.minecraft.client.settings.KeyBinding; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MLabel.java index b9896802..a7fc06c1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MLabel.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabelAndElement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MLabelAndElement.java index c47eda61..20f2aa93 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabelAndElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MLabelAndElement.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MList.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MList.java index cb755963..bfdcae26 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MList.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MList.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModal.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModal.java index be2c64d6..1a2abc6e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModal.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalConfirmation.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModalConfirmation.java index 92f3b258..746d1afa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalConfirmation.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModalConfirmation.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalMessage.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModalMessage.java index 28d23d48..1973e239 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalMessage.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MModalMessage.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MNavigatingPane.java index 4ad6bd45..76de53d5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MNavigatingPane.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; import com.google.common.base.Function; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPanelScaledGUI.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPanelScaledGUI.java index ed84b880..0941116a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPanelScaledGUI.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPanelScaledGUI.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; -import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MParameter.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MParameter.java index ee9b0619..72f64de1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MParameter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MParameter.java @@ -16,14 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.Parameter; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonParameterEdit; -import kr.syeyoung.dungeonsguide.roomedit.panes.DynamicEditor; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.Parameter; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonParameterEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes.DynamicEditor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPassiveLabelAndElement.java index 4a56d411..9a4cd791 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPassiveLabelAndElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPassiveLabelAndElement.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPopupMenu.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPopupMenu.java index 6db97d51..bc2a656b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPopupMenu.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPopupMenu.java @@ -16,18 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.MathHelper; -import org.lwjgl.opengl.GL11; import java.awt.*; import java.util.List; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPortableColorEdit.java index f8a7281a..d86a07ee 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MPortableColorEdit.java @@ -16,16 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; -import lombok.Setter; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MRootPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MRootPanel.java index 4172acb8..949dd0d3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MRootPanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MRootPanel.java @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MScrollBar.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MScrollBar.java index dbc30e7e..e8ea25bd 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MScrollBar.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MScrollBar.java @@ -16,12 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.Gui; @@ -31,7 +30,7 @@ import java.awt.*; public class MScrollBar extends MPanel { private final Axis axis; - @Setter + @Getter private int thumbSize, max, min; @Setter diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MScrollablePanel.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MScrollablePanel.java index d5f27227..c791d7a2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MScrollablePanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MScrollablePanel.java @@ -16,15 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; -import lombok.Setter; import net.minecraft.client.gui.Gui; import net.minecraft.util.MathHelper; -import org.w3c.dom.css.Rect; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MSpacer.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MSpacer.java index 11336a7c..f891946e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MSpacer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MSpacer.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MStringSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MStringSelectionButton.java index f2dcadce..92472180 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MStringSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MStringSelectionButton.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTabbedPane.java index ba56679b..ae06fb37 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTabbedPane.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTextField.java index d87c08e3..20378c20 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTextField.java @@ -16,17 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.MathHelper; import org.lwjgl.input.Keyboard; @@ -37,8 +35,6 @@ import java.awt.*; import java.awt.datatransfer.*; import java.awt.event.KeyEvent; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; @Getter public class MTextField extends MPanel { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MToggleButton.java index 4d1e6fb7..ee336d77 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MToggleButton.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTooltip.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTooltip.java index 62ff1e2f..b11afb04 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTooltip.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTooltip.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTooltipText.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTooltipText.java index e3d0a3c4..8ea9068f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTooltipText.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MTooltipText.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MValue.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MValue.java index db461d60..1a251dc0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MValue.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/gui/elements/MValue.java @@ -16,13 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.gui.elements; +package kr.syeyoung.dungeonsguide.mod.gui.elements; -import kr.syeyoung.dungeonsguide.roomedit.EditingContext; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonValueEdit; -import kr.syeyoung.dungeonsguide.roomedit.valueedit.ValueEditOffsetPointSet; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext; +import kr.syeyoung.dungeonsguide.mod.gui.MPanel; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui.GuiDungeonValueEdit; +import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditOffsetPointSet; import lombok.Getter; import lombok.Setter; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyContext.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyContext.java index 87d1a264..6cab82b3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyContext.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyContext.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.chat; +package kr.syeyoung.dungeonsguide.mod.party; import lombok.Data; import net.minecraft.client.Minecraft; @@ -34,6 +34,8 @@ public class PartyContext { private Set<String> partyModerator; private boolean isModeratorComplete; private Set<String> partyMember; private boolean isMemberComplete; + private Set<String> dgUsers; + private Set<String> partyRawMembers = new HashSet<>(); private boolean isRawMemberComplete; private Boolean allInvite; @@ -62,9 +64,16 @@ public class PartyContext { this.partyMember.add(partyMember); addRawMember(partyMember); } - public void addRawMember(String partyMember){ + + public void addDgUser(String partyMember) { + if (this.dgUsers == null) this.dgUsers = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); + this.dgUsers.add(partyMember); + } + + public void addRawMember(String partyMember) { partyRawMembers.add(partyMember); } + public void removeFromParty(String username) { if (username.equalsIgnoreCase(partyOwner)) { partyOwner = null; @@ -73,7 +82,11 @@ public class PartyContext { if (partyMember != null) partyMember.remove(username); partyRawMembers.remove(username); } - + + + public boolean isDgUser(String username) { + return dgUsers != null && dgUsers.contains(username); + } public boolean hasModerator(String username) { return partyModerator != null && partyModerator.contains(username); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java index 3053c74c..6e5d9aa9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java @@ -16,13 +16,17 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.chat; - -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.events.HypixelJoinedEvent; -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; -import kr.syeyoung.dungeonsguide.stomp.*; -import kr.syeyoung.dungeonsguide.utils.TextUtils; +package kr.syeyoung.dungeonsguide.mod.party; + +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessResult; +import kr.syeyoung.dungeonsguide.mod.chat.ChatProcessor; +import kr.syeyoung.dungeonsguide.mod.chat.ChatSubscriber; +import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.events.impl.HypixelJoinedEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.StompConnectedEvent; +import kr.syeyoung.dungeonsguide.mod.features.impl.advanced.FeatureTestPepole; +import kr.syeyoung.dungeonsguide.mod.stomp.*; +import kr.syeyoung.dungeonsguide.mod.utils.TextUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; @@ -35,7 +39,7 @@ import java.security.SecureRandom; import java.util.*; import java.util.function.Consumer; -public class PartyManager implements StompMessageHandler { +public class PartyManager { public static final PartyManager INSTANCE = new PartyManager(); @Getter private PartyContext partyContext; @@ -62,42 +66,48 @@ public class PartyManager implements StompMessageHandler { public PartyManager() { ChatProcessor cp = ChatProcessor.INSTANCE; // Not in Party - cp.subscribe((str, a) -> { - if (str.equals("§cYou are not currently in a party.§r") - || str.equals("§eYou left the party.§r") - || str.equals("§cYou must be in a party to join the party channel!§r") - || str.equals("§cThe party was disbanded because all invites expired and the party was empty§r") - || str.equals("§cYou are not in a party and were moved to the ALL channel.§r") - || str.startsWith("§cThe party was disbanded") - || str.endsWith("§ehas disbanded the party!§r") - || str.startsWith("§cYou are not in a party") - || str.startsWith("§eYou have been kicked from the party by ")) { - leaveParty(); - - for (Consumer<PartyContext> partyContextConsumer : partyBuiltCallback) { - try { - partyContextConsumer.accept(null); - } catch (Exception e) { - e.printStackTrace(); + cp.subscribe(new ChatSubscriber() { + @Override + public ChatProcessResult process(String str, Map<String, Object> a) { + if (str.equals("§cYou are not currently in a party.§r") + || str.equals("§eYou left the party.§r") + || str.equals("§cYou must be in a party to join the party channel!§r") + || str.equals("§cThe party was disbanded because all invites expired and the party was empty§r") + || str.equals("§cYou are not in a party and were moved to the ALL channel.§r") + || str.startsWith("§cThe party was disbanded") + || str.endsWith("§ehas disbanded the party!§r") + || str.startsWith("§cYou are not in a party") + || str.startsWith("§eYou have been kicked from the party by ")) { + PartyManager.this.leaveParty(); + + for (Consumer<PartyContext> partyContextConsumer : partyBuiltCallback) { + try { + partyContextConsumer.accept(null); + } catch (Exception e) { + e.printStackTrace(); + } } + partyBuiltCallback.clear(); + a.put("type", "notinparty"); } - partyBuiltCallback.clear(); - a.put("type", "notinparty"); + return ChatProcessResult.NONE; } - return ChatProcessResult.NONE; }); // All invite - cp.subscribe((str, a) -> { - if (str.endsWith("§aenabled All Invite§r")) { - getPartyContext(true).setAllInvite(true); - a.put("type", "allinvite_on"); - } else if (str.endsWith("§cdisabled All Invite§r") - || str.equals("§cYou are not allowed to invite players.§r")) { - getPartyContext(true).setAllInvite(false); - a.put("type", "allinvite_off"); - potentialInvitenessChange(); + cp.subscribe(new ChatSubscriber() { + @Override + public ChatProcessResult process(String str, Map<String, Object> a) { + if (str.endsWith("§aenabled All Invite§r")) { + PartyManager.this.getPartyContext(true).setAllInvite(true); + a.put("type", "allinvite_on"); + } else if (str.endsWith("§cdisabled All Invite§r") + || str.equals("§cYou are not allowed to invite players.§r")) { + PartyManager.this.getPartyContext(true).setAllInvite(false); + a.put("type", "allinvite_off"); + PartyManager.this.potentialInvitenessChange(); + } + return ChatProcessResult.NONE; } - return ChatProcessResult.NONE; }); // Member building cp.subscribe(new ChatSubscriber() { @@ -170,153 +180,159 @@ public class PartyManager implements StompMessageHandler { } }); // Player party join / leave - cp.subscribe((str ,a) -> { - if (str.endsWith("§ejoined the party.§r")) { - String username = null; - for (String s : TextUtils.stripColor(str).split(" ")) { - if (s.startsWith("[")) continue; - username = s; - break; - } - if (username != null) { - getPartyContext(true).addPartyMember(username); - } - a.put("type", "party_join"); - } else if (str.endsWith("§ehas been removed from the party.§r") - || str.endsWith("§ehas left the party.§r")) { - String username = null; - for (String s : TextUtils.stripColor(str).split(" ")) { - if (s.startsWith("[")) continue; - username = s; - break; - } - if (username != null && partyContext != null) { - getPartyContext().removeFromParty(username); - } - a.put("type", "party_leave"); - } else if (str.endsWith(" They have §r§c60 §r§eseconds to accept.§r")) { - String[] messageSplit = TextUtils.stripColor(str).split(" "); - String inviter = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - inviter = s; - break; - } - if (inviter != null && partyContext != null) { - if (getPartyContext().hasMember(inviter)) { - getPartyContext().setAllInvite(true); + cp.subscribe(new ChatSubscriber() { + @Override + public ChatProcessResult process(String str, Map<String, Object> a) { + if (str.endsWith("§ejoined the party.§r")) { + String username = null; + for (String s : TextUtils.stripColor(str).split(" ")) { + if (s.startsWith("[")) continue; + username = s; + break; + } + if (username != null) { + PartyManager.this.getPartyContext(true).addPartyMember(username); + } + a.put("type", "party_join"); + } else if (str.endsWith("§ehas been removed from the party.§r") + || str.endsWith("§ehas left the party.§r")) { + String username = null; + for (String s : TextUtils.stripColor(str).split(" ")) { + if (s.startsWith("[")) continue; + username = s; + break; + } + if (username != null && partyContext != null) { + PartyManager.this.getPartyContext().removeFromParty(username); + } + a.put("type", "party_leave"); + } else if (str.endsWith(" They have §r§c60 §r§eseconds to accept.§r")) { + String[] messageSplit = TextUtils.stripColor(str).split(" "); + String inviter = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + inviter = s; + break; + } + if (inviter != null && partyContext != null) { + if (PartyManager.this.getPartyContext().hasMember(inviter)) { + PartyManager.this.getPartyContext().setAllInvite(true); + } + } + PartyManager.this.getPartyContext(true).setPartyExistHypixel(true); + a.put("type", "party_invite_exist"); + } else if (str.equals("§cCouldn't find a player with that name!§r") || str.equals("§cYou cannot invite that player since they're not online.")) { + a.put("type", "party_invite_noexist"); + String username = Minecraft.getMinecraft().getSession().getUsername(); + if (partyContext != null && PartyManager.this.getPartyContext().hasMember(username)) { + PartyManager.this.getPartyContext().setAllInvite(true); } } - getPartyContext(true).setPartyExistHypixel(true); - a.put("type", "party_invite_exist"); - } else if (str.equals("§cCouldn't find a player with that name!§r") || str.equals("§cYou cannot invite that player since they're not online.")) { - a.put("type", "party_invite_noexist"); - String username = Minecraft.getMinecraft().getSession().getUsername(); - if (partyContext != null && getPartyContext().hasMember(username)) { - getPartyContext().setAllInvite(true); - } + return ChatProcessResult.NONE; } - return ChatProcessResult.NONE; }); // Promotion - cp.subscribe((str, a) -> { - if (str.startsWith("§eThe party was transferred to ")) { - // §eThe party was transferred to §r§b[MVP§r§f+§r§b] apotato321 §r§eby §r§a[VIP§r§6+§r§a] syeyoung§r - String[] messageSplit = TextUtils.stripColor(str.substring(31)).split(" "); - String newLeader = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - newLeader = s; - break; - } - String oldLeader; - boolean left= false; - if (str.endsWith("§r§eleft§r")) { - oldLeader = messageSplit[messageSplit.length-2]; - left = true; - } else { - oldLeader = messageSplit[messageSplit.length-1]; - } + cp.subscribe(new ChatSubscriber() { + @Override + public ChatProcessResult process(String str, Map<String, Object> a) { + if (str.startsWith("§eThe party was transferred to ")) { + // §eThe party was transferred to §r§b[MVP§r§f+§r§b] apotato321 §r§eby §r§a[VIP§r§6+§r§a] syeyoung§r + String[] messageSplit = TextUtils.stripColor(str.substring(31)).split(" "); + String newLeader = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + newLeader = s; + break; + } + String oldLeader; + boolean left = false; + if (str.endsWith("§r§eleft§r")) { + oldLeader = messageSplit[messageSplit.length - 2]; + left = true; + } else { + oldLeader = messageSplit[messageSplit.length - 1]; + } - if (oldLeader != null && newLeader != null ) { - getPartyContext(true).setPartyOwner(newLeader); - if (left) - getPartyContext(true).removeFromParty(oldLeader); - else - getPartyContext(true).addPartyModerator(oldLeader); - } - a.put("type", "party_transfer"); - potentialInvitenessChange(); - } else if (str.endsWith("§eto Party Leader§r")) { - // §a[VIP§r§6+§r§a] syeyoung§r§e has promoted §r§b[MVP§r§f+§r§b] apotato321 §r§eto Party Leader§r - String[] messageSplit = TextUtils.stripColor(str).split(" "); - String oldLeader = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - oldLeader = s; - break; - } - messageSplit = TextUtils.stripColor(str.substring(str.indexOf("has promoted") + 13)).split(" "); - String newLeader = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - newLeader = s; - break; - } + if (oldLeader != null && newLeader != null) { + PartyManager.this.getPartyContext(true).setPartyOwner(newLeader); + if (left) + PartyManager.this.getPartyContext(true).removeFromParty(oldLeader); + else + PartyManager.this.getPartyContext(true).addPartyModerator(oldLeader); + } + a.put("type", "party_transfer"); + PartyManager.this.potentialInvitenessChange(); + } else if (str.endsWith("§eto Party Leader§r")) { + // §a[VIP§r§6+§r§a] syeyoung§r§e has promoted §r§b[MVP§r§f+§r§b] apotato321 §r§eto Party Leader§r + String[] messageSplit = TextUtils.stripColor(str).split(" "); + String oldLeader = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + oldLeader = s; + break; + } + messageSplit = TextUtils.stripColor(str.substring(str.indexOf("has promoted") + 13)).split(" "); + String newLeader = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + newLeader = s; + break; + } - if (oldLeader != null && newLeader != null) { - getPartyContext(true).setPartyOwner(newLeader); - getPartyContext(true).addPartyModerator(oldLeader); - } - a.put("type", "party_transfer"); - potentialInvitenessChange(); - } else if (str.endsWith("§r§eto Party Moderator§r")) { - // §b[MVP§r§f+§r§b] apotato321§r§e has promoted §r§a[VIP§r§6+§r§a] syeyoung §r§eto Party Moderator§r - String[] messageSplit = TextUtils.stripColor(str).split(" "); - String oldLeader = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - oldLeader = s; - break; - } - messageSplit = TextUtils.stripColor(str.substring(str.indexOf("has promoted") + 13)).split(" "); - String newModerator = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - newModerator = s; - break; - } + if (oldLeader != null && newLeader != null) { + PartyManager.this.getPartyContext(true).setPartyOwner(newLeader); + PartyManager.this.getPartyContext(true).addPartyModerator(oldLeader); + } + a.put("type", "party_transfer"); + PartyManager.this.potentialInvitenessChange(); + } else if (str.endsWith("§r§eto Party Moderator§r")) { + // §b[MVP§r§f+§r§b] apotato321§r§e has promoted §r§a[VIP§r§6+§r§a] syeyoung §r§eto Party Moderator§r + String[] messageSplit = TextUtils.stripColor(str).split(" "); + String oldLeader = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + oldLeader = s; + break; + } + messageSplit = TextUtils.stripColor(str.substring(str.indexOf("has promoted") + 13)).split(" "); + String newModerator = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + newModerator = s; + break; + } - if (oldLeader != null && newModerator != null) { - getPartyContext(true).setPartyOwner(oldLeader); - getPartyContext(true).addPartyModerator(newModerator); - } - a.put("type", "party_promotion"); - potentialInvitenessChange(); - } else if (str.endsWith("§r§eto Party Member§r")) { - String[] messageSplit = TextUtils.stripColor(str).split(" "); - String oldLeader = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - oldLeader = s; - break; - } - messageSplit = TextUtils.stripColor(str.substring(str.indexOf("has demoted") + 12)).split(" "); - String newMember = null; - for (String s : messageSplit) { - if (s.startsWith("[")) continue; - newMember = s; - break; - } + if (oldLeader != null && newModerator != null) { + PartyManager.this.getPartyContext(true).setPartyOwner(oldLeader); + PartyManager.this.getPartyContext(true).addPartyModerator(newModerator); + } + a.put("type", "party_promotion"); + PartyManager.this.potentialInvitenessChange(); + } else if (str.endsWith("§r§eto Party Member§r")) { + String[] messageSplit = TextUtils.stripColor(str).split(" "); + String oldLeader = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + oldLeader = s; + break; + } + messageSplit = TextUtils.stripColor(str.substring(str.indexOf("has demoted") + 12)).split(" "); + String newMember = null; + for (String s : messageSplit) { + if (s.startsWith("[")) continue; + newMember = s; + break; + } - if (oldLeader != null && newMember != null) { - getPartyContext(true).setPartyOwner(oldLeader); - getPartyContext(true).addPartyMember(newMember); + if (oldLeader != null && newMember != null) { + PartyManager.this.getPartyContext(true).setPartyOwner(oldLeader); + PartyManager.this.getPartyContext(true).addPartyMember(newMember); + } + a.put("type", "party_demotion"); + PartyManager.this.potentialInvitenessChange(); } - a.put("type", "party_demotion"); - potentialInvitenessChange(); + return ChatProcessResult.NONE; } - return ChatProcessResult.NONE; }); // Player Join cp.subscribe(new ChatSubscriber() { @@ -353,20 +369,24 @@ public class PartyManager implements StompMessageHandler { return ChatProcessResult.NONE; }}); // Player Join Dungon - cp.subscribe((str, a)-> { - if (str.contains("§r§ejoined the dungeon group! (§r§b")) { - String username = TextUtils.stripColor(str).split(" ")[3]; - if (username.equalsIgnoreCase(Minecraft.getMinecraft().getSession().getUsername())) { - partyContext = new PartyContext(); - requestPartyList((str2) -> { - potentialInvitenessChange(); - }); - } else { - getPartyContext(true).setMemberComplete(false); - requestPartyList((str2) -> {}); + cp.subscribe(new ChatSubscriber() { + @Override + public ChatProcessResult process(String str, Map<String, Object> a) { + if (str.contains("§r§ejoined the dungeon group! (§r§b")) { + String username = TextUtils.stripColor(str).split(" ")[3]; + if (username.equalsIgnoreCase(Minecraft.getMinecraft().getSession().getUsername())) { + partyContext = new PartyContext(); + PartyManager.this.requestPartyList((str2) -> { + PartyManager.this.potentialInvitenessChange(); + }); + } else { + PartyManager.this.getPartyContext(true).setMemberComplete(false); + PartyManager.this.requestPartyList((str2) -> { + }); + } } + return ChatProcessResult.NONE; } - return ChatProcessResult.NONE; }); } @@ -386,8 +406,7 @@ public class PartyManager implements StompMessageHandler { } askToJoinSecret = secretBuilder.toString(); - StompInterface stompInterface = DungeonsGuide.getDungeonsGuide().getStompConnection(); - stompInterface.send(new StompPayload().payload(new JSONObject().put("secret", askToJoinSecret).toString()).header("destination", "/app/party.setjoinsecret")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("secret", askToJoinSecret).toString()).destination("/app/party.setjoinsecret")); } public static ChatSubscriber dashShredder() { @@ -429,8 +448,7 @@ public class PartyManager implements StompMessageHandler { if (getPartyContext().getPartyID() != null) { JSONObject object = new JSONObject(); object.put("partyid", getPartyContext().getPartyID()); - StompInterface stompInterface = DungeonsGuide.getDungeonsGuide().getStompConnection(); - stompInterface.send(new StompPayload().payload(object.toString()).header("destination", "/app/party.leave")); + StompManager.getInstance().send(new StompPayload().payload(object.toString()).destination( "/app/party.leave")); } } @@ -451,8 +469,7 @@ public class PartyManager implements StompMessageHandler { } JSONObject object = new JSONObject(); object.put("members", jsonArray); - StompInterface stompInterface = DungeonsGuide.getDungeonsGuide().getStompConnection(); - stompInterface.send(new StompPayload().payload(object.toString()).header("destination", "/app/party.join")); + StompManager.getInstance().send(new StompPayload().payload(object.toString()).destination("/app/party.join")); getPartyContext().setPartyID("!@#!@#!@#..........FETCHING..........$!@$!@$!@$"+UUID.randomUUID().toString()); } @@ -496,51 +513,77 @@ public class PartyManager implements StompMessageHandler { private Map<String, Long> playerInvAntiSpam = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - @Override - public void handle(StompInterface stompInterface, StompPayload stompPayload) { - JSONObject object = new JSONObject(stompPayload.payload()); - if ("/user/queue/party.check".equals(stompPayload.headers().get("destination"))) { + @SubscribeEvent + public void stompConnect(StompConnectedEvent event) { + + event.getStompInterface().subscribe("/user/queue/party.resp", (stompClient ,payload) -> { + JSONObject object = new JSONObject(payload); + + String str = object.getString("status"); + if ("success".equals(str) && partyContext != null) { + getPartyContext().setPartyID(object.getString("partyId")); + if (askToJoinSecret != null) { + updateAskToJoin(); + } + } else if (partyContext != null){ + getPartyContext().setPartyID(null); + } + }); + + event.getStompInterface().subscribe("/user/queue/party.check", (stompClient ,payload) -> { + JSONObject object = new JSONObject(payload); String playerName = object.getString("player"); String token = object.getString("token"); if (partyContext == null) { requestPartyList((pc) -> { boolean contains = pc.getPartyRawMembers().contains(playerName); if (!contains) { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(new JSONObject().put("status", "failure").put("token", token).toString()).header("destination", "/app/party.check.resp")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("status", "failure").put("token", token).toString()).destination("/app/party.check.resp")); } else { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(new JSONObject().put("status", "success").put("token", token).toString()).header("destination", "/app/party.check.resp")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("status", "success").put("token", token).toString()).destination("/app/party.check.resp")); } }); } else { if (getPartyContext().getPartyRawMembers().contains(playerName)) { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(new JSONObject().put("status", "success").put("token", token).toString()).header("destination", "/app/party.check.resp")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("status", "success").put("token", token).toString()).destination("/app/party.check.resp")); } else if (getPartyContext().isMemberComplete() && getPartyContext().isModeratorComplete() && getPartyContext().getPartyOwner() != null) { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(new JSONObject().put("status", "failure").put("token", token).toString()).header("destination", "/app/party.check.resp")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("status", "failure").put("token", token).toString()).destination("/app/party.check.resp")); } else { requestPartyList((pc) -> { boolean contains = pc.getPartyRawMembers().contains(playerName); if (!contains) { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(new JSONObject().put("status", "failure").put("token", token).toString()).header("destination", "/app/party.check.resp")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("status", "failure").put("token", token).toString()).destination("/app/party.check.resp")); } else { - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().payload(new JSONObject().put("status", "success").put("token", token).toString()).header("destination", "/app/party.check.resp")); + StompManager.getInstance().send(new StompPayload().payload(new JSONObject().put("status", "success").put("token", token).toString()).destination("/app/party.check.resp")); } }); } } - } else if ("/user/queue/party.broadcast".equals(stompPayload.headers().get("destination"))) { - try { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: Message Broadcasted from player:: \n" + new JSONObject(stompPayload.payload()).getString("payload"))); - } catch (Exception e) { - e.printStackTrace(); + }); + event.getStompInterface().subscribe("/user/queue/party.broadcast", (stompClient ,payload) -> { + String broadCastPlayload = new JSONObject(payload).getString("payload"); + System.out.println("Received broadcast"); + if(broadCastPlayload.startsWith("C:")) { + FeatureTestPepole.handlePartyBroadCast(broadCastPlayload); + }else { + try { + ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: Message Broadcasted from player:: \n" + new JSONObject(payload).getString("payload"))); + } catch (Exception e) { + e.printStackTrace(); + } } - } else if ("/user/queue/party.join".equals(stompPayload.headers().get("destination"))) { + }); + event.getStompInterface().subscribe("/user/queue/party.join", (stompClient ,payload) -> { + JSONObject object = new JSONObject(payload); String playerName = object.getString("player"); String secret = object.getString("secret"); if (secret.equals(askToJoinSecret) && partyContext != null && getPartyContext().getPartyRawMembers().size() < maxParty && playerInvAntiSpam.getOrDefault(playerName, 0L) < System.currentTimeMillis() - 5000) { playerInvAntiSpam.put(playerName, System.currentTimeMillis()); ChatProcessor.INSTANCE.addToChatQueue("/p invite "+playerName,() -> {}, true); } - } else if ("/user/queue/party.askedtojoin.resp".equals(stompPayload.headers().get("destination"))) { + }); + event.getStompInterface().subscribe("/user/queue/party.askedtojoin.resp", (stompClient ,payload) -> { + JSONObject object = new JSONObject(payload); String invFrom = object.getString("username"); String token2 = object.getString("token"); if (!token2.equals(lastToken)) return; @@ -562,31 +605,9 @@ public class PartyManager implements StompMessageHandler { } return ChatProcessResult.NONE; }); - } else { - String str = object.getString("status"); - if ("success".equals(str) && partyContext != null) { - getPartyContext().setPartyID(object.getString("partyId")); - if (askToJoinSecret != null) { - updateAskToJoin(); - } - } else if (partyContext != null){ - getPartyContext().setPartyID(null); - } - } - } + }); + - @SubscribeEvent - public void stompConnect(StompConnectedEvent stompConnectedEvent) { - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.resp").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.check").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.broadcast").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.join").build()); - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.askedtojoin.resp").build()); } private String lastToken; @@ -594,8 +615,8 @@ public class PartyManager implements StompMessageHandler { lastToken = secret; if (partyContext != null && getPartyContext().isPartyExistHypixel()) ChatProcessor.INSTANCE.addToChatQueue("/p leave", () -> {}, true); - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().method(StompHeader.SEND) - .header("destination", "/app/party.askedtojoin") + StompManager.getInstance().send(new StompPayload().method(StompHeader.SEND) + .destination("/app/party.askedtojoin") .payload(new JSONObject().put("token", secret).toString())); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/resources/DGTexturePack.java index b9646993..6c8c9a30 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/resources/DGTexturePack.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.resources; +package kr.syeyoung.dungeonsguide.mod.resources; -import kr.syeyoung.dungeonsguide.Authenticator; +import kr.syeyoung.dungeonsguide.auth.ResourceManager; import lombok.AllArgsConstructor; import net.minecraft.client.resources.IResourcePack; import net.minecraft.client.resources.data.IMetadataSection; @@ -35,18 +35,17 @@ import java.util.Set; @AllArgsConstructor public class DGTexturePack implements IResourcePack { - private final Authenticator authenticator; @Override public InputStream getInputStream(ResourceLocation location) throws IOException { InputStream inputStream = this.getClass().getResourceAsStream("/assets/dg/"+location.getResourcePath()); if (inputStream != null) return inputStream; - return new ByteArrayInputStream(authenticator.getResources().get("assets/dg/"+location.getResourcePath())); + return new ByteArrayInputStream(ResourceManager.getInstance().getResources().get("assets/dg/"+location.getResourcePath())); } @Override public boolean resourceExists(ResourceLocation location) { - return authenticator.getResources().containsKey("assets/dg/"+location.getResourcePath()) + return ResourceManager.getInstance().getResources().containsKey("assets/dg/"+location.getResourcePath()) || this.getClass().getResourceAsStream("/assets/dg/"+location.getResourcePath()) != null; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/FailedWebSocketConnection.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/FailedWebSocketConnection.java new file mode 100644 index 00000000..15f79dde --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/FailedWebSocketConnection.java @@ -0,0 +1,7 @@ +package kr.syeyoung.dungeonsguide.mod.stomp; + +public class FailedWebSocketConnection extends RuntimeException{ + public FailedWebSocketConnection(String message) { + super(message); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompClient.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompClient.java new file mode 100644 index 00000000..84705a1d --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompClient.java @@ -0,0 +1,192 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.mod.stomp; + +import lombok.Getter; +import net.minecraftforge.common.MinecraftForge; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.handshake.ServerHandshake; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +public class StompClient extends WebSocketClient { + + Logger logger = LogManager.getLogger("StompClient"); + public StompClient(URI serverUri, final String token) throws InterruptedException { + super(serverUri); + + + addHeader("Authorization", token); + + logger.info("connecting websocket"); + if (!connectBlocking()) { + throw new FailedWebSocketConnection("Cant connect to ws"); + } + + logger.info("connected, stomp handshake"); + while(this.stompClientStatus == StompClientStatus.CONNECTING); + logger.info("fully connected"); + } + + + @Getter + private volatile StompClientStatus stompClientStatus = StompClientStatus.CONNECTING; + + @Getter + private StompPayload errorPayload; + + private ScheduledFuture heartbeat = null; + + private static final ScheduledExecutorService ex = Executors.newScheduledThreadPool(1); + @Override + public void onOpen(ServerHandshake handshakedata) { + send(new StompPayload().method(StompHeader.CONNECT) + .header("accept-version","1.2") + .header("heart-beat", "30000,30000") + .header("host",uri.getHost()).getBuilt() + ); + } + + @Override + public void onMessage(String message) { + try { + StompPayload payload = StompPayload.parse(message); + + switch (payload.method()){ + case SEND: + case SUBSCRIBE: + case UNSUBSCRIBE: + case BEGIN: + case COMMIT: + case ABORT: + case ACK: + case NACK: + case DISCONNECT: + case STOMP: + break; + case CONNECTED: + stompClientStatus = StompClientStatus.CONNECTED; + + String serverHeartbeat = payload.headers().get("heart-beat"); + if (serverHeartbeat != null) { + int heartbeatMS = 30; + this.heartbeat = ex.scheduleAtFixedRate(() -> send("\n"), heartbeatMS-1, heartbeatMS-1, TimeUnit.SECONDS); + } + + break; + case MESSAGE: + String subscriptionName = payload.headers().get("subscription"); + int subscriptionId = Integer.parseInt(subscriptionName); + StompSubscription listener = stompSubscriptionMap.get(subscriptionId); + + listener.process(this, payload.payload()); + + break; + case RECEIPT: + String receiptId = payload.headers().get("receipt-id"); + StompPayload payload1 = receiptMap.remove(Integer.parseInt(receiptId)); + if (payload1.method() == StompHeader.DISCONNECT) { + stompClientStatus = StompClientStatus.DISCONNECTED; + close(); + } + break; + case ERROR: + errorPayload = payload; + stompClientStatus = StompClientStatus.ERROR; + this.close(); + break; + + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void onClose(int code, String reason, boolean remote) { + if (heartbeat != null) heartbeat.cancel(true); + + MinecraftForge.EVENT_BUS.post(new StompDiedEvent(code, reason, remote)); + + } + + @Override + public void onError(Exception ex) { + if(ex != null){ + ex.printStackTrace(); + } + } + + + private final Map<Integer, StompSubscription> stompSubscriptionMap = new HashMap<>(); + private final Map<Integer, StompPayload> receiptMap = new HashMap<>(); + + private int idIncrement = 0; + + private void makeSureStompIsConnected() { + if (stompClientStatus != StompClientStatus.CONNECTED) throw new IllegalStateException("not connected"); + } + + public void sendfake(StompPayload payload) { + makeSureStompIsConnected(); + payload.method(StompHeader.SEND); + if (payload.headers().get("receipt") != null) + receiptMap.put(Integer.parseInt(payload.headers().get("receipt")), payload); + send(payload.getBuilt()); + } + + public void subscribe(String destination, StompSubscription listener) { + makeSureStompIsConnected(); + int id = ++idIncrement; + + send(new StompPayload() + .method(StompHeader.SUBSCRIBE) + .header("id", String.valueOf(id)) + .destination(destination) + .header("ack", "auto") + .getBuilt() + ); + + stompSubscriptionMap.put(id, listener); + } + + + public void disconnect() { + makeSureStompIsConnected(); + stompClientStatus =StompClientStatus.DISCONNECTING; + + StompPayload stompPayload = new StompPayload().method(StompHeader.DISCONNECT).header("receipt", String.valueOf(++idIncrement)); + + send(stompPayload.getBuilt()); + receiptMap.put(idIncrement, stompPayload); + } + + + public enum StompClientStatus { + CONNECTING, CONNECTED, ERROR, DISCONNECTING, DISCONNECTED + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompDiedEvent.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompDiedEvent.java new file mode 100644 index 00000000..33913424 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompDiedEvent.java @@ -0,0 +1,15 @@ +package kr.syeyoung.dungeonsguide.mod.stomp; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Data +@EqualsAndHashCode(callSuper=false) +@AllArgsConstructor +public class StompDiedEvent extends Event { + int code; + String reason; + boolean remote; +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompHeader.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompHeader.java index f0b7a06b..7755d8a6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompHeader.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompHeader.java @@ -16,11 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.stomp; +package kr.syeyoung.dungeonsguide.mod.stomp; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; public enum StompHeader { SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, COMMIT, ABORT, ACK, NACK, DISCONNECT, CONNECT, STOMP, CONNECTED, MESSAGE, RECEIPT, ERROR diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompManager.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompManager.java new file mode 100644 index 00000000..31b3b961 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompManager.java @@ -0,0 +1,73 @@ +package kr.syeyoung.dungeonsguide.mod.stomp; + +import com.google.common.base.Throwables; +import kr.syeyoung.dungeonsguide.auth.AuthManager; +import kr.syeyoung.dungeonsguide.mod.events.impl.StompConnectedEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.net.URI; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +public class StompManager { + Logger logger = LogManager.getLogger("StompManager"); + public static final String STOMP_URL = "wss://dungeons.guide/ws"; + // private String stompURL = "ws://localhost/ws"; + static StompManager instance; + + public static StompManager getInstance() { + if (instance == null) { + instance = new StompManager(); + MinecraftForge.EVENT_BUS.register(instance); + } + return instance; + } + + public void init() { + connectStomp(); + } + + private StompClient stompConnection; + + + public boolean isStompConnected(){ + if(stompConnection != null && stompConnection.getStompClientStatus() == StompClient.StompClientStatus.CONNECTED) return true; + return false; + } + + public void send(StompPayload payload){ + if(stompConnection != null){ + stompConnection.sendfake(payload); + } else { + logger.error("OOPS STOMP CONNECTION IS NULL AND SOMEONE TRIED TO SEND SOMETHING THIS SHOULD NOT HAPPEN"); + } + } + + ScheduledExecutorService ex = Executors.newSingleThreadScheduledExecutor(); + + @SubscribeEvent + public void onStompDied(StompDiedEvent event) { + logger.info("Stomp Connection closed, trying to reconnect - {} - {}", event.reason, event.code); + connectStomp(); + } + + public void connectStomp() { + ex.schedule(() -> { + if (AuthManager.getInstance().getToken() == null) return; + try { + if (stompConnection != null) { + stompConnection.disconnect(); + } + stompConnection = new StompClient(new URI(StompManager.STOMP_URL), AuthManager.getInstance().getToken()); + MinecraftForge.EVENT_BUS.post(new StompConnectedEvent(stompConnection)); + } catch (Exception e) { + logger.error("Failed to connect to Stomp with message: {}", String.valueOf(Throwables.getRootCause(e))); + } + + }, 5L, TimeUnit.SECONDS); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompPayload.java index 27b1cdc9..8bfb8543 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompPayload.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.stomp; +package kr.syeyoung.dungeonsguide.mod.stomp; -import kr.syeyoung.dungeonsguide.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import lombok.Data; -import lombok.Singular; import lombok.experimental.Accessors; import java.util.*; @@ -29,7 +28,7 @@ import java.util.*; @Accessors(chain = true, fluent = true) public class StompPayload { private StompHeader method; - private Map<String, String> headers = new HashMap<String, String>(); + private Map<String, String> headers = new HashMap<>(); private String payload; public StompPayload header(String key, String value) { @@ -37,6 +36,17 @@ public class StompPayload { return this; } + + public StompPayload destination(String value){ + headers.put("destination", value); + return this; + } + + public StompPayload id(String value){ + headers.put("id", value); + return this; + } + public String getBuilt() { StringBuilder sb = new StringBuilder(); sb.append(method.name()); @@ -53,7 +63,7 @@ public class StompPayload { if (payload != null) sb.append(payload); sb.append((char) 0); - if (FeatureRegistry.DEBUG.isEnabled()) System.out.println("Sending.. "+sb.toString()); + if (FeatureRegistry.DEBUG.isEnabled()) System.out.println("Sending.. "+ sb); return sb.toString(); } @@ -63,7 +73,7 @@ public class StompPayload { Scanner scanner = new Scanner(payload); StompPayload stompPayload = new StompPayload(); stompPayload.method = StompHeader.valueOf(scanner.nextLine()); - String line = ""; + String line; while (!(line = scanner.nextLine()).isEmpty()) { int index = line.indexOf(":"); if (index == -1) throw new IllegalArgumentException("No : found in headers section"); @@ -76,7 +86,7 @@ public class StompPayload { stompPayload.headers.put(name, value); } - List<String> lines = new ArrayList<String>(); + List<String> lines = new ArrayList<>(); while (scanner.hasNextLine() && !(line = scanner.nextLine()).equals("\0")) { lines.add(line); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompSubscription.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompSubscription.java new file mode 100644 index 00000000..965eaae9 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/stomp/StompSubscription.java @@ -0,0 +1,6 @@ +package kr.syeyoung.dungeonsguide.mod.stomp; + +@FunctionalInterface +public interface StompSubscription { + void process(StompClient stompInterface, String stompPayload); +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/AhUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/AhUtils.java index 049f8a0d..6e6bdf52 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/AhUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/AhUtils.java @@ -16,37 +16,48 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; - -import java.security.*; -import java.security.cert.CertificateException; -import java.util.HashMap; -import java.util.Map; +package kr.syeyoung.dungeonsguide.mod.utils; +import com.google.common.base.Throwables; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import kr.syeyoung.dungeonsguide.DungeonsGuide; +import kr.syeyoung.dungeonsguide.auth.AuthManager; +import kr.syeyoung.dungeonsguide.auth.AuthUtil; +import kr.syeyoung.dungeonsguide.mod.events.impl.AuthChangedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; -import java.util.Timer; -import java.util.TimerTask; +import java.security.*; +import java.security.cert.CertificateException; +import java.util.*; public class AhUtils { public static volatile Map<String, AuctionData> auctions = new HashMap<String, AuctionData>(); + static Logger logger = LogManager.getLogger("AhUtils"); + public static Timer timer = new Timer(); public static int totalAuctions = 0; + @SubscribeEvent + public void onAuthChanged(AuthChangedEvent event) { + if(AuthManager.getInstance().isPlebUser()){ + registerTimer(); + } + } + public static void registerTimer() { timer.schedule(new TimerTask() { public void run() { try { AhUtils.loadAuctions(); } catch (CertificateException | NoSuchAlgorithmException | InvalidKeyException | InvalidAlgorithmParameterException | NoSuchPaddingException | BadPaddingException | KeyStoreException | IllegalBlockSizeException | KeyManagementException e) { - e.printStackTrace(); + logger.error("Error loading auctions {}", String.valueOf(Throwables.getRootCause(e))); } } }, 0L, 1800000L); @@ -56,7 +67,7 @@ public class AhUtils { try { Map<String, AuctionData> semi_auctions = new HashMap<String, AuctionData>(); - JsonElement object = DungeonsGuide.getDungeonsGuide().getAuthenticator().getJsonSecured("https://dungeons.guide/resource/keys"); + JsonElement object = AuthUtil.getJsonSecured("https://dungeons.guide/resource/keys"); for (JsonElement element : object.getAsJsonArray()) { JsonObject object1 = element.getAsJsonObject(); AuctionData auctionData = new AuctionData(object1.get("id").getAsString()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/ArrayUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ArrayUtils.java index 8b84da13..be5b1088 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/ArrayUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ArrayUtils.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; public class ArrayUtils { public static int[][] rotateCounterClockwise(int[][] arr) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/BlockCache.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/BlockCache.java new file mode 100644 index 00000000..b8313778 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/BlockCache.java @@ -0,0 +1,50 @@ +package kr.syeyoung.dungeonsguide.mod.utils; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.util.BlockPos; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.jetbrains.annotations.NotNull; + +import java.util.concurrent.TimeUnit; + +public class BlockCache { + public BlockCache() { + MinecraftForge.EVENT_BUS.register(this); + } + + @SuppressWarnings("UnstableApiUsage") + private final LoadingCache<BlockPos, IBlockState> cache = CacheBuilder.newBuilder() + .maximumSize(10000) + .expireAfterWrite(3, TimeUnit.SECONDS) + .build( + new CacheLoader<BlockPos, IBlockState>() { + public IBlockState load(@NotNull BlockPos pos) { + return Minecraft.getMinecraft().theWorld.getBlockState(pos); + } + }); + + + @SuppressWarnings("UnstableApiUsage") + public IBlockState getBlockState(@NotNull BlockPos pos){ + if(FeatureRegistry.DEBUG_BLOCK_CACHING.isEnabled()){ + return cache.getUnchecked(pos); + } else { + return Minecraft.getMinecraft().theWorld.getBlockState(pos); + } + } + + + @SubscribeEvent @SuppressWarnings("UnstableApiUsage") + public void onWorldLoad(WorldEvent.Load e){ + cache.invalidateAll(); + } + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/GlStateUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/GlStateUtils.java index 2737be9d..4fee85d0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/GlStateUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/GlStateUtils.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; -import com.sun.org.apache.xpath.internal.operations.Bool; import net.minecraft.client.renderer.GlStateManager; import java.lang.reflect.Field; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/MapUtils.java index 8fb90ec1..cf16cb93 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/MapUtils.java @@ -16,11 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; import lombok.Getter; import net.minecraft.block.material.MapColor; -import org.w3c.dom.css.Rect; import javax.vecmath.Vector2d; import java.awt.*; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/RenderUtils.java index 18f09cb0..065986c5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/RenderUtils.java @@ -16,17 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; -import kr.syeyoung.dungeonsguide.config.types.AColor; -import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.mod.config.types.AColor; +import kr.syeyoung.dungeonsguide.mod.dungeon.doorfinder.DungeonDoor; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityOtherPlayerMP; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.RenderManager; @@ -35,8 +32,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.passive.EntityBat; import net.minecraft.util.*; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ScoreBoardUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ScoreBoardUtils.java new file mode 100644 index 00000000..b14041e8 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ScoreBoardUtils.java @@ -0,0 +1,58 @@ +package kr.syeyoung.dungeonsguide.mod.utils; + +import net.minecraft.client.Minecraft; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; + +import java.util.function.Consumer; + +public class ScoreBoardUtils { + + public static void forEachLine(Consumer<String> lineConsumer){ + Scoreboard scoreboard = Minecraft.getMinecraft().thePlayer.getWorldScoreboard(); + ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + for (Score sc : scoreboard.getSortedScores(objective)) { + ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(sc.getPlayerName()); + String line = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()).trim(); + String stripped = TextUtils.keepScoreboardCharacters(TextUtils.stripColor(line)); +// if (line.contains("[") && line.endsWith("❤")) { +// String name = stripped.split(" ")[stripped.split(" ").length - 2]; +// int health = Integer.parseInt(stripped.split(" ")[stripped.split(" ").length - 1]); +// if (health < lowestHealth) { +// lowestHealth = health; +// lowestHealthName = name; +// } +// } + + lineConsumer.accept(line); + + } + } + + public static void forEachLineClean(Consumer<String> lineConsumer){ + Scoreboard scoreboard = Minecraft.getMinecraft().thePlayer.getWorldScoreboard(); + ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + for (Score sc : scoreboard.getSortedScores(objective)) { + ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(sc.getPlayerName()); + String line = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()).trim(); + String stripped = TextUtils.keepScoreboardCharacters(TextUtils.stripColor(line)); +// if (line.contains("[") && line.endsWith("❤")) { +// String name = stripped.split(" ")[stripped.split(" ").length - 2]; +// int health = Integer.parseInt(stripped.split(" ")[stripped.split(" ").length - 1]); +// if (health < lowestHealth) { +// lowestHealth = health; +// lowestHealthName = name; +// } +// } + + lineConsumer.accept(stripped); + + } + } + + + + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/ShortUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ShortUtils.java index b3bc3cd4..523988d1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/ShortUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/ShortUtils.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; public class ShortUtils { public static short rotateCounterClockwise(short integer) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/SkyblockUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/SkyblockUtils.java index a480415e..6d7af229 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/SkyblockUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/SkyblockUtils.java @@ -16,16 +16,14 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import net.minecraft.util.ChatComponentText; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; -import java.net.MalformedURLException; import java.net.URL; public class SkyblockUtils { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TabListUtil.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TabListUtil.java new file mode 100644 index 00000000..91ccb4fd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TabListUtil.java @@ -0,0 +1,75 @@ +package kr.syeyoung.dungeonsguide.mod.utils; + +import kr.syeyoung.dungeonsguide.mod.features.impl.dungeon.FeatureDungeonMap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.scoreboard.ScorePlayerTeam; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TabListUtil { + final static Pattern tabListRegex = Pattern.compile("\\*[a-zA-Z0-9_]{2,16}\\*", Pattern.MULTILINE); + + public static List<String> getPlayersInDungeon(){ + List<String> players = new ArrayList<>(); + List<NetworkPlayerInfo> list = FeatureDungeonMap.sorter.sortedCopy(Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()); + + if(list.size() >= 20){ + for (int i = 1; i < 20; i++) { + + String na = getPlayerNameWithChecks(list.get(i)); + + if(na != null){ + players.add(na); + } + } + } + + return players; + } + + /** + * We make sure that the player is alive and regex their name out + * @param networkPlayerInfo the network player info of player + * @return the username of player + */ + @Nullable + public static String getPlayerNameWithChecks(NetworkPlayerInfo networkPlayerInfo) { + String name; + if (networkPlayerInfo.getDisplayName() != null) { + name = networkPlayerInfo.getDisplayName().getFormattedText(); + } else { + name = ScorePlayerTeam.formatPlayerName( + networkPlayerInfo.getPlayerTeam(), + networkPlayerInfo.getGameProfile().getName() + ); + } + + if (name.trim().equals("§r") || name.startsWith("§r ")) return null; + + name = TextUtils.stripColor(name); + + if(name.contains("(DEAD)")) { + return null; + } + + return getString(name, tabListRegex); + } + + @Nullable + public static String getString(String name, Pattern tabListRegex) { + name = name.replace(" ", "*"); + + Matcher matcher = tabListRegex.matcher(name); + if (!matcher.find()) return null; + + name = matcher.group(0); + name = name.substring(0, name.length() - 1); + name = name.substring(1); + return name; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TextUtils.java index 1f3548a6..1da4e8e7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TextUtils.java @@ -16,9 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; -import java.text.DecimalFormat; import java.util.List; import java.util.Map; import java.util.TreeMap; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/TimeScoreUtil.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TimeScoreUtil.java index f43a1f17..def77def 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/TimeScoreUtil.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TimeScoreUtil.java @@ -16,17 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; import kr.syeyoung.dungeonsguide.Main; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; import org.apache.commons.io.IOUtils; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.util.List; import java.util.Map; import java.util.TreeMap; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TitleRender.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TitleRender.java new file mode 100644 index 00000000..dfc0b0a1 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/TitleRender.java @@ -0,0 +1,139 @@ +package kr.syeyoung.dungeonsguide.mod.utils; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +/** + * STOLEN FROM VANILLA 1.8.9, DONT @ ME + * CREDS TO MOJANG AND THE CREW + */ +public class TitleRender { + + Logger logger = LogManager.getLogger("TitleRender"); + + private static TitleRender instance; + public static TitleRender getInstance() { + return instance == null ? instance = new TitleRender() : instance; + } + + private TitleRender() { + MinecraftForge.EVENT_BUS.register(this); + } + + protected static int titlesTimer; + /** + * The current title displayed + */ + protected static String displayedTitle = ""; + /** + * The current sub-title displayed + */ + protected static String displayedSubTitle = ""; + /** + * The time that the title take to fade in + */ + protected static int titleFadeIn; + /** + * The time that the title is display + */ + protected static int titleDisplayTime; + + /** + * The time that the title take to fade out + */ + protected static int titleFadeOut; + Minecraft mc = Minecraft.getMinecraft(); + + FontRenderer fontRenderer = mc.fontRendererObj; + + + @SubscribeEvent + public void onClinetTick(TickEvent.ClientTickEvent e){ + if(e.phase == TickEvent.Phase.START){ + tick(); + } + } + + @SubscribeEvent + public void onGameOverLay(RenderGameOverlayEvent.Post e){ + if (!(e.type == RenderGameOverlayEvent.ElementType.EXPERIENCE || e.type == RenderGameOverlayEvent.ElementType.JUMPBAR)) return; + GlStateManager.enableBlend(); + draw(e.partialTicks); + } + + + void tick(){ + if (titlesTimer > 0) { + --titlesTimer; + if (titlesTimer <= 0) { + displayedTitle = ""; + displayedSubTitle = ""; + } + } + } + + + public static void clearTitle(){ + displayedTitle = ""; + displayedSubTitle = ""; + titlesTimer = 0; + } + + + public static void displayTitle(@NotNull String title, String subTitle, int timeFadeIn, int displayTime, int timeFadeOut) { + displayedTitle = title; + displayedSubTitle = subTitle; + titleFadeIn = timeFadeIn; + titleDisplayTime = displayTime; + titleFadeOut = timeFadeOut; + titlesTimer = titleFadeIn + titleDisplayTime + titleFadeOut; + } + + void draw(float partialTicks){ + float g; + int l; + ScaledResolution scaledResolution = new ScaledResolution(mc); + int i = scaledResolution.getScaledWidth(); + int j = scaledResolution.getScaledHeight(); + if (titlesTimer > 0) { + g = titlesTimer - partialTicks; + l = 255; + if (titlesTimer > titleFadeOut + titleDisplayTime) { + float h = (float)(titleFadeIn + titleDisplayTime + titleFadeOut) - g; + l = (int)(h * 255.0f / (float)titleFadeIn); + } + if (titlesTimer <= titleFadeOut) { + float h = g; + l = (int)(h * 255.0f / (float)titleFadeOut); + } + if ((l = MathHelper.clamp_int(l, 0, 255)) > 8) { + GlStateManager.pushMatrix(); + GlStateManager.translate(i / 2, j / 2, 0.0f); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + GlStateManager.scale(6.0f, 6.0f, 6.0f); + int m = l << 24 & 0xFF000000; + fontRenderer.drawString(displayedTitle, -fontRenderer.getStringWidth(displayedTitle) / 2, -10.0f, 0xFFFFFF | m, true); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(2.0f, 2.0f, 2.0f); + fontRenderer.drawString(displayedSubTitle, -fontRenderer.getStringWidth(displayedSubTitle) / 2, 5.0f, 0xFFFFFF | m, true); + GlStateManager.popMatrix(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + } + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/VectorUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/VectorUtils.java index 59eaa866..f3e51578 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/VectorUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/VectorUtils.java @@ -16,12 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; import lombok.AllArgsConstructor; import lombok.Data; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.util.Vec3; import javax.vecmath.Vector2d; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/XPUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/XPUtils.java index ebdd87ab..12804565 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/XPUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/XPUtils.java @@ -16,9 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils; +package kr.syeyoung.dungeonsguide.mod.utils; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.playerprofile.dataclasses.Skill; +import kr.syeyoung.dungeonsguide.mod.features.impl.party.playerpreview.api.playerprofile.dataclasses.Skill; import lombok.Data; import java.util.Map; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/CursorReader.java index 11a9da51..48dcc357 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/CursorReader.java @@ -16,27 +16,23 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils.cursor; +package kr.syeyoung.dungeonsguide.mod.utils.cursor; import com.google.common.io.LittleEndianDataInputStream; -import com.google.common.io.LittleEndianDataOutputStream; import com.twelvemonkeys.imageio.plugins.bmp.CURImageReader; -import com.twelvemonkeys.imageio.plugins.bmp.CURImageReaderSpi; -import com.twelvemonkeys.imageio.plugins.bmp.ICOImageReader; import lombok.Data; import javax.imageio.ImageIO; -import javax.imageio.ImageReader; import javax.imageio.stream.ImageInputStream; import java.awt.image.BufferedImage; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; public class CursorReader { public static List<CursorData> readFromInputStream(InputStream inputStream) throws IOException { - System.out.println(inputStream); LittleEndianDataInputStream dataInputStream = new LittleEndianDataInputStream(new BufferedInputStream(inputStream)); dataInputStream.mark(Integer.MAX_VALUE); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/EnumCursor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/EnumCursor.java index 20cccef7..e7762ba5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/EnumCursor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/EnumCursor.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils.cursor; +package kr.syeyoung.dungeonsguide.mod.utils.cursor; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/Foundation.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/Foundation.java index b08ad378..7474c85a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/Foundation.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/Foundation.java @@ -16,12 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils.cursor; +package kr.syeyoung.dungeonsguide.mod.utils.cursor; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Pointer; -import com.sun.jna.Structure; public interface Foundation extends Library { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/GLCursors.java index a3932955..23f62fa5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/GLCursors.java @@ -16,29 +16,27 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils.cursor; +package kr.syeyoung.dungeonsguide.mod.utils.cursor; -import com.sun.jna.Memory; +import com.google.common.base.Throwables; import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; -import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.input.Cursor; import sun.misc.Unsafe; -import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; @@ -49,7 +47,14 @@ import java.util.Map; import java.util.stream.Collectors; +@SuppressWarnings("unsafe") public class GLCursors { + + static Logger logger = LogManager.getLogger("DG-GlCursors"); + + @SuppressWarnings("unsafe") + static boolean verbose = false; + private static Unsafe unsafe; private static Class cursorElement; private static Constructor constructor; @@ -94,7 +99,7 @@ public class GLCursors { break; } } catch (Throwable e) { - System.out.println("Error occured while loading cursor: "+value); + if(verbose) logger.error("Error occured while loading cursor: {}", value); e.printStackTrace(); } try { @@ -112,11 +117,13 @@ public class GLCursors { CursorReader.CursorData cursorData = cursorDataList2.size() == 0 ? cursorDataList.get(0) : cursorDataList2.get(0); - System.out.println(cursorData); + if(verbose) logger.info(cursorData); bufferedImage = cursorData.getBufferedImage(); hotspotX = cursorData.getXHotSpot(); hotspotY = cursorData.getYHotSpot(); - } catch (Throwable t) {t.printStackTrace();} + } catch (Throwable t) { + if(verbose) logger.error("loading currsor failed with message, {}", String.valueOf(Throwables.getRootCause(t))); + } int width = bufferedImage == null ? 16 : bufferedImage.getWidth(); @@ -140,7 +147,7 @@ public class GLCursors { c = new Cursor(effWidth, effHeight, hotspotX, height - hotspotY - 1,1,intBuffer, null); } } catch (Throwable e) { - System.out.println("Error occured while loading cursor from resource: "+value); + if(verbose) logger.error("Error occured while loading cursor from resource: "+value); e.printStackTrace(); } if (c != null) { @@ -150,14 +157,14 @@ public class GLCursors { for (Field declaredField : cursor.getClass().getDeclaredFields()) { declaredField.setAccessible(true); Object obj = declaredField.get(cursor); - System.out.println(declaredField.getName()+": "+obj+" - "+(obj instanceof ByteBuffer)); + if(verbose) logger.info(declaredField.getName()+": "+obj+" - "+(obj instanceof ByteBuffer)); if (obj instanceof ByteBuffer) { ByteBuffer b = (ByteBuffer) declaredField.get(cursor); StringBuilder sb = new StringBuilder("Contents: "); for (int i = 0; i < b.limit(); i++) { sb.append(Integer.toHexString(b.get(i) & 0xFF)).append(" "); } - System.out.println(sb.toString()); + if(verbose) logger.info(sb.toString()); } } } catch (IllegalAccessException e) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/User32.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/User32.java index 5bcd2599..dfbbc03d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/User32.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/User32.java @@ -16,12 +16,11 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils.cursor; +package kr.syeyoung.dungeonsguide.mod.utils.cursor; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Pointer; -import com.sun.jna.Structure; public interface User32 extends Library { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/X11.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/X11.java index caf8ae10..dc5a8894 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/X11.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/utils/cursor/X11.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.utils.cursor; +package kr.syeyoung.dungeonsguide.mod.utils.cursor; import com.sun.jna.Library; import com.sun.jna.Native; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/wsresource/StaticResource.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/wsresource/StaticResource.java index 814fb8c8..f682513f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/wsresource/StaticResource.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/wsresource/StaticResource.java @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.wsresource; +package kr.syeyoung.dungeonsguide.mod.wsresource; import lombok.Data; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/wsresource/StaticResourceCache.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/wsresource/StaticResourceCache.java index db781844..cd213115 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/wsresource/StaticResourceCache.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/wsresource/StaticResourceCache.java @@ -16,14 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.wsresource; +package kr.syeyoung.dungeonsguide.mod.wsresource; -import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.events.StompConnectedEvent; -import kr.syeyoung.dungeonsguide.stomp.StompInterface; -import kr.syeyoung.dungeonsguide.stomp.StompMessageHandler; -import kr.syeyoung.dungeonsguide.stomp.StompPayload; -import kr.syeyoung.dungeonsguide.stomp.StompSubscription; +import kr.syeyoung.dungeonsguide.mod.events.impl.StompConnectedEvent; +import kr.syeyoung.dungeonsguide.mod.stomp.*; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.json.JSONObject; @@ -32,7 +28,7 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.CompletableFuture; -public class StaticResourceCache implements StompMessageHandler { +public class StaticResourceCache { public static final StaticResourceCache INSTANCE = new StaticResourceCache(); private Map<UUID, StaticResource> staticResourceMap = new HashMap<>(); @@ -48,29 +44,27 @@ public class StaticResourceCache implements StompMessageHandler { if (staticResourceMap.containsKey(resourceID)) return CompletableFuture.completedFuture(staticResourceMap.get(resourceID)); if (staticResourceRequest.containsKey(resourceID)) return staticResourceRequest.get(resourceID); - DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().header("destination", "/app/staticresource.get").payload(resourceID.toString())); + StompManager.getInstance().send(new StompPayload().destination("/app/staticresource.get").payload(resourceID.toString())); CompletableFuture<StaticResource> comp = new CompletableFuture<>(); staticResourceRequest.put(resourceID, comp); return comp; } - @Override - public void handle(StompInterface stompInterface, StompPayload stompPayload) { - JSONObject object = new JSONObject(stompPayload.payload()); - StaticResource staticResource = new StaticResource(); - staticResource.setResourceID(UUID.fromString(object.getString("resourceID"))); - staticResource.setExists(object.getBoolean("exists")); - staticResource.setValue((!object.has("value") || object.isNull("value")) ? null : object.getString("value")); + @SubscribeEvent + public void stompConnect(StompConnectedEvent event) { - staticResourceMap.put(staticResource.getResourceID(), staticResource); - CompletableFuture<StaticResource> completed = staticResourceRequest.remove(staticResource.getResourceID()); - if (completed != null) completed.complete(staticResource); - } + event.getStompInterface().subscribe("/user/queue/staticresource.get", (stompClient ,payload) -> { + JSONObject object = new JSONObject(payload); + StaticResource staticResource = new StaticResource(); + staticResource.setResourceID(UUID.fromString(object.getString("resourceID"))); + staticResource.setExists(object.getBoolean("exists")); + staticResource.setValue((!object.has("value") || object.isNull("value")) ? null : object.getString("value")); + + staticResourceMap.put(staticResource.getResourceID(), staticResource); + CompletableFuture<StaticResource> completed = staticResourceRequest.remove(staticResource.getResourceID()); + if (completed != null) completed.complete(staticResource); + }); - @SubscribeEvent - public void stompConnect(StompConnectedEvent stompConnectedEvent) { - stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() - .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/staticresource.get").build()); getResource(BONUS_SCORE); getResource(TRIVIA_ANSWERS); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/CloseListener.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/CloseListener.java deleted file mode 100644 index fdb177a3..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/CloseListener.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.stomp; - -public interface CloseListener { - void onClose(int code, String reason, boolean remote); -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClient.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClient.java deleted file mode 100644 index 7226c1d6..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClient.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.stomp; - -import lombok.Getter; -import org.java_websocket.client.WebSocketClient; -import org.java_websocket.handshake.ServerHandshake; -import org.java_websocket.server.DefaultSSLWebSocketServerFactory; -import sun.security.ssl.SSLSocketFactoryImpl; - -import javax.net.ssl.*; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.Socket; -import java.net.URI; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - -public class StompClient extends WebSocketClient implements StompInterface { - public StompClient(URI serverUri, final String token, CloseListener closeListener) throws Exception { - super(serverUri); - this.closeListener = closeListener; - addHeader("Authorization", token); - - System.out.println("connecting websocket"); - if (!connectBlocking()) { - throw new RuntimeException("Can't connect to ws"); - } - System.out.println("connected, stomp handshake"); - while(this.stompClientStatus == StompClientStatus.CONNECTING); - System.out.println("fully connected"); - } - private final CloseListener closeListener; - - @Getter - private volatile StompClientStatus stompClientStatus = StompClientStatus.CONNECTING; - - @Getter - private StompPayload errorPayload; - - private ScheduledFuture heartbeat = null; - - private static final ScheduledExecutorService ex = Executors.newScheduledThreadPool(1); - - @Override - public void onOpen(ServerHandshake handshakedata) { - send(new StompPayload().method(StompHeader.CONNECT) - .header("accept-version","1.2") - .header("heart-beat", "30000,30000") - .header("host",uri.getHost()).getBuilt() - ); - } - - @Override - public void onMessage(String message) { - try { - StompPayload payload = StompPayload.parse(message); - if (payload.method() == StompHeader.CONNECTED) { - stompClientStatus = StompClientStatus.CONNECTED; - - String heartbeat = payload.headers().get("heart-beat"); - if (heartbeat != null) { -// int sx = Integer.parseInt(heartbeat.split(",")[0]); -// int sy = Integer.parseInt(heartbeat.split(",")[1]); -// -// if (sy == 0) return; - int heartbeatMS = 30000; - this.heartbeat = ex.scheduleAtFixedRate(() -> { - send("\n"); - }, heartbeatMS-1000, heartbeatMS-1000, TimeUnit.MILLISECONDS); - } - - } else if (payload.method() == StompHeader.ERROR) { - errorPayload = payload; - stompClientStatus = StompClientStatus.ERROR; - this.close(); - } else if (payload.method() == StompHeader.MESSAGE) { - // mesage - StompSubscription stompSubscription = stompSubscriptionMap.get(Integer.parseInt(payload.headers().get("subscription"))); - try { - stompSubscription.getStompMessageHandler().handle(this, payload); - if (stompSubscription.getAckMode() != StompSubscription.AckMode.AUTO) { - send(new StompPayload().method(StompHeader.ACK) - .header("id",payload.headers().get("ack")).getBuilt() - ); - } - } catch (Exception e) { - e.printStackTrace(); - if (stompSubscription.getAckMode() != StompSubscription.AckMode.AUTO) { - send(new StompPayload().method(StompHeader.NACK) - .header("id",payload.headers().get("ack")).getBuilt() - ); - } - } - } else if (payload.method() == StompHeader.RECEIPT) { - String receipt_id = payload.headers().get("receipt-id"); - StompPayload payload1 = receiptMap.remove(Integer.parseInt(receipt_id)); - if (payload1.method() == StompHeader.DISCONNECT) { - stompClientStatus = StompClientStatus.DISCONNECTED; - close(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onClose(int code, String reason, boolean remote) { - if (heartbeat != null) heartbeat.cancel(true); - closeListener.onClose(code, reason, remote); - } - - @Override - public void onError(Exception ex) { - ex.printStackTrace(); - } - - private final Map<Integer, StompSubscription> stompSubscriptionMap = new HashMap<Integer, StompSubscription>(); - private final Map<Integer, StompPayload> receiptMap = new HashMap<Integer, StompPayload>(); - - private int idIncrement = 0; - - @Override - public void send(StompPayload payload) { - if (stompClientStatus != StompClientStatus.CONNECTED) throw new IllegalStateException("not connected"); - payload.method(StompHeader.SEND); - if (payload.headers().get("receipt") != null) - receiptMap.put(Integer.parseInt(payload.headers().get("receipt")), payload); - send(payload.getBuilt()); - } - - @Override - public void subscribe(StompSubscription stompSubscription) { - if (stompClientStatus != StompClientStatus.CONNECTED) throw new IllegalStateException("not connected"); - stompSubscription.setId(++idIncrement); - - send(new StompPayload().method(StompHeader.SUBSCRIBE) - .header("id",String.valueOf(stompSubscription.getId())) - .header("destination", stompSubscription.getDestination()) - .header("ack", stompSubscription.getAckMode().getValue()).getBuilt() - ); - - stompSubscriptionMap.put(stompSubscription.getId(), stompSubscription); - } - - @Override - public void unsubscribe(StompSubscription stompSubscription) { - if (stompClientStatus != StompClientStatus.CONNECTED) throw new IllegalStateException("not connected"); - send(new StompPayload().method(StompHeader.UNSUBSCRIBE) - .header("id",String.valueOf(stompSubscription.getId())).getBuilt() - ); - stompSubscriptionMap.remove(stompSubscription.getId()); - } - - @Override - public void disconnect() { - if (stompClientStatus != StompClientStatus.CONNECTED) throw new IllegalStateException("not connected"); - StompPayload stompPayload; - stompClientStatus =StompClientStatus.DISCONNECTING; - send((stompPayload = new StompPayload().method(StompHeader.DISCONNECT) - .header("receipt", String.valueOf(++idIncrement))) - .getBuilt() - ); - receiptMap.put(idIncrement, stompPayload); - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClientStatus.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClientStatus.java deleted file mode 100644 index ef3f907c..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompClientStatus.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.stomp; - -public enum StompClientStatus { - CONNECTING, CONNECTED, ERROR, DISCONNECTING, DISCONNECTED -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompInterface.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompInterface.java deleted file mode 100644 index 8244fd58..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompInterface.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.stomp; - -public interface StompInterface { - void send(StompPayload payload); - void subscribe(StompSubscription stompSubscription); - void unsubscribe(StompSubscription stompSubscription); - void disconnect(); -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompMessageHandler.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompMessageHandler.java deleted file mode 100644 index 8b3efd77..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompMessageHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.stomp; - -public interface StompMessageHandler { - void handle(StompInterface stompInterface, StompPayload stompPayload); -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompSubscription.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompSubscription.java deleted file mode 100644 index 790ba344..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompSubscription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -package kr.syeyoung.dungeonsguide.stomp; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.Getter; - -@Data -@Builder -public class StompSubscription { - private int id; - private String destination; - private StompMessageHandler stompMessageHandler; - private AckMode ackMode; - - @AllArgsConstructor - public enum AckMode { - AUTO("auto"), CLIENT("client"), CLIENT_INDIVIDUAL("client-individual"); - - @Getter - private final String value; - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/url/DGConnection.java b/src/main/java/kr/syeyoung/dungeonsguide/url/DGConnection.java index 725abab9..6e9520ef 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/url/DGConnection.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/url/DGConnection.java @@ -18,18 +18,20 @@ package kr.syeyoung.dungeonsguide.url; -import kr.syeyoung.dungeonsguide.Authenticator; +import kr.syeyoung.dungeonsguide.auth.ResourceManager; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.net.URLConnection; public class DGConnection extends URLConnection { - private final Authenticator authenticator; - protected DGConnection(URL url, Authenticator a) { + + protected DGConnection(URL url) { super(url); connected = false; - this.authenticator = a; } @Override @@ -37,10 +39,10 @@ public class DGConnection extends URLConnection { } @Override public InputStream getInputStream() throws IOException { - if (authenticator != null) { + if (ResourceManager.getInstance().getResources() != null) { String path = url.getPath().substring(1); - if (!authenticator.getResources().containsKey(path)) throw new FileNotFoundException(); - return new ByteArrayInputStream(authenticator.getResources().get(path)); + if (!ResourceManager.getInstance().getResources().containsKey(path)) throw new FileNotFoundException(); + return new ByteArrayInputStream(ResourceManager.getInstance().getResources().get(path)); } throw new FileNotFoundException(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandler.java b/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandler.java index bc6fa10d..f740848f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandler.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandler.java @@ -18,7 +18,6 @@ package kr.syeyoung.dungeonsguide.url; -import kr.syeyoung.dungeonsguide.Authenticator; import lombok.AllArgsConstructor; import java.io.IOException; @@ -28,9 +27,8 @@ import java.net.URLStreamHandler; @AllArgsConstructor public class DGStreamHandler extends URLStreamHandler { - private final Authenticator auth; @Override protected URLConnection openConnection(URL url) throws IOException { - return new DGConnection(url, this.auth); + return new DGConnection(url); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandlerFactory.java b/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandlerFactory.java index 9f574a86..00b1e5f2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandlerFactory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/url/DGStreamHandlerFactory.java @@ -18,7 +18,6 @@ package kr.syeyoung.dungeonsguide.url; -import kr.syeyoung.dungeonsguide.Authenticator; import lombok.AllArgsConstructor; import java.net.URLStreamHandler; @@ -26,11 +25,10 @@ import java.net.URLStreamHandlerFactory; @AllArgsConstructor public class DGStreamHandlerFactory implements URLStreamHandlerFactory { - private final Authenticator auth; @Override public URLStreamHandler createURLStreamHandler(String protocol) { if ("z".equals(protocol)) { - return new DGStreamHandler(this.auth); + return new DGStreamHandler(); } return null; } diff --git a/src/main/resources/assets/dg/textures/dglogox128.png b/src/main/resources/assets/dg/textures/dglogox128.png Binary files differnew file mode 100644 index 00000000..3558d9da --- /dev/null +++ b/src/main/resources/assets/dg/textures/dglogox128.png diff --git a/src/main/resources/assets/dg/textures/dglogox32.png b/src/main/resources/assets/dg/textures/dglogox32.png Binary files differnew file mode 100644 index 00000000..62962d7e --- /dev/null +++ b/src/main/resources/assets/dg/textures/dglogox32.png diff --git a/src/main/resources/assets/skyblock_dungeons_guide/sounds.json b/src/main/resources/assets/skyblock_dungeons_guide/sounds.json new file mode 100644 index 00000000..5c28a55b --- /dev/null +++ b/src/main/resources/assets/skyblock_dungeons_guide/sounds.json @@ -0,0 +1,10 @@ +{ + "readysetgo": { + "category" : "player", + "sounds": [{ + "name": "skyblock_dungeons_guide:readysetgo", + "stream": true + } + ] + } +} diff --git a/src/main/resources/assets/skyblock_dungeons_guide/sounds/readysetgo.ogg b/src/main/resources/assets/skyblock_dungeons_guide/sounds/readysetgo.ogg Binary files differnew file mode 100644 index 00000000..12470b8e --- /dev/null +++ b/src/main/resources/assets/skyblock_dungeons_guide/sounds/readysetgo.ogg diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 70df65aa..2e1a5e46 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -4,10 +4,10 @@ "name": "Skyblock Dungeons Guide", "description": "A mod to help dungeon players to find and solve secrets and puzzles most efficiently.", "version": "${version}", - "mcversion": "${mcversion}", - "url": "", + "mcversion": "1.8.9", + "url": "https://discord.gg/dg", "updateUrl": "", - "authorList": ["syeyoung"], + "authorList": ["syeyoung", "kokoniara"], "credits": "The guild Jerry's Crew, for nothing.", "logoFile": "", "screenshots": [], |