The District of Joban Difference between revisions of "JCM:Mixins"

Difference between revisions of "JCM:Mixins"

From The District of Joban
Line 4: Line 4:
This mixin applies to Minecraft's Title Screen, used for version checking with MTR once the title screen appears.
This mixin applies to Minecraft's Title Screen, used for version checking with MTR once the title screen appears.


==== Injected Method ====
===== TitleScreen.tick (at = TAIL) =====
 
===== TitleScreen.tick (at=TAIL) =====
[[JCM:MTR Version Check|If Player's MTR Version did not meet JCM's required MTR Version]] and is previously not warned:
[[JCM:MTR Version Check|If Player's MTR Version did not meet JCM's required MTR Version]] and is previously not warned:


Line 13: Line 11:
=== MixinTicketBarrier ===
=== MixinTicketBarrier ===
This mixin applies to MTR's TicketSystem, used for Fare Saver to discount player's ride.
This mixin applies to MTR's TicketSystem, used for Fare Saver to discount player's ride.
==== Injected Method ====


===== TicketSystem.onExit (at = HEAD) =====
===== TicketSystem.onExit (at = HEAD) =====
Line 47: Line 43:


This has been replaced by a network receiver, and later removed all together as of [[JCM:1.0.4|'''v1.0.4''']]
This has been replaced by a network receiver, and later removed all together as of [[JCM:1.0.4|'''v1.0.4''']]
==== Injected Method ====


===== openTicketMachineScreenS2C (at = HEAD, cancellable = true) =====
===== openTicketMachineScreenS2C (at = HEAD, cancellable = true) =====

Revision as of 16:08, 18 March 2023

This page lists all mixins Joban Client Mod applies:

MixinTitleScreen

This mixin applies to Minecraft's Title Screen, used for version checking with MTR once the title screen appears.

TitleScreen.tick (at = TAIL)

If Player's MTR Version did not meet JCM's required MTR Version and is previously not warned:

  1. Set the screen to an incompatible version screen

MixinTicketBarrier

This mixin applies to MTR's TicketSystem, used for Fare Saver to discount player's ride.

TicketSystem.onExit (at = HEAD)

If the current player have a discount applied:

  1. Get The Entry Zone Score
  2. If Entry Zone Score is 0, it is counted as evasion.
  3. Don't apply the discount if player is evading
  4. Calculate fare of his ride
  5. Add either the discounted value back to player's balance, or the balance of his fare. So it won't give player money.
  6. Display the action bar to player.

Removed mixins

CeilingBrushMixin (Removed)

This mixin cancels MTR's automatic ceiling from changing, so player can create custom ceiling pattern.

This is removed as of v1.0.4, due to MTR now having a lit and unlit version, making this unnecessary.

Overridden Method

onUse()

If player has brush:

  1. cycle the block between a lit version and a unlit version.
getStateForNeighborUpdate()

Return the original state to prevent MTR from changing to an unlit version again.

TicketMachineMixin (Removed)

This mixin applies to MTR's PacketTrainDataGuiClient, used to display an alternate Ticket Machine Screen with text applied to the top. (Not noticeable as the text is just empty and you need a resource pack to override the lang file)

This has been replaced by a network receiver, and later removed all together as of v1.0.4

openTicketMachineScreenS2C (at = HEAD, cancellable = true)
  1. Get the balance player has
  2. Set player's screen to an alternated Ticket Machine Screen