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

Difference between revisions of "JCM:Mixins"

From The District of Joban
(Created page with "This page lists all mixins Joban Client Mod applies: === MixinTicketBarrier === This mixin applies to MTR's TicketSystem, used for Fare Saver to discount player's ride. ==== Injected Method ==== ===== TicketSystem.onExit (at = HEAD) ===== If the current player have a discount applied: # Get The Entry Zone Score # If Entry Zone Score is 0, it is counted as evasion. # Don't apply the discount if player is evading # Calculate fare of his ride # Add either the discounted...")
 
Line 15: Line 15:
# Add either the discounted value back to player's balance, or the balance of his fare. So it won't give player money.
# Add either the discounted value back to player's balance, or the balance of his fare. So it won't give player money.
# Display the action bar to player.
# Display the action bar to player.
== Removed mixins ==


=== CeilingBrushMixin (Removed) ===
=== CeilingBrushMixin (Removed) ===

Revision as of 20:36, 17 August 2022

This page lists all mixins Joban Client Mod applies:

MixinTicketBarrier

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

Injected Method

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.

TicketSystemMixin (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

Injected Method

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