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

Difference between revisions of "JCM:Mixins"

From The District of Joban
Tag: Reverted
 
(5 intermediate revisions by 2 users not shown)
Line 3: Line 3:
=== 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 16: Line 14:
# Display the action bar to player.
# Display the action bar to player.


== <div class="mw-collapsed">Removed mixins</div> ==
== Removed mixins ==


=== CeilingBrushMixin (Removed) ===
=== CeilingBrushMixin (Removed) ===
Line 33: Line 31:
Return the original state to prevent MTR from changing to an unlit version again.
Return the original state to prevent MTR from changing to an unlit version again.


=== TicketSystemMixin (Removed) ===
=== 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 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 [[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) =====
Line 44: Line 40:
# Get the balance player has
# Get the balance player has
# Set player's screen to an alternated Ticket Machine Screen
# Set player's screen to an alternated Ticket Machine Screen
=== MixinTitleScreen (Removed) ===
This mixin applies to Minecraft's Title Screen, used for version checking with MTR once the title screen appears.
'''This mixin has caused incompatibilities with the mod ImmediatelyFast v1.2'''
'''This is anticipated to be removed in [[JCM:2.0.0|v2.0.0]] with the assumption that MTR 4 would comply with SemVer, and the modloader would be responsible for checking the MTR mod version rather than us.'''
===== 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:
# Set the screen to an incompatible version screen

Latest revision as of 11:26, 15 October 2023

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.

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

MixinTitleScreen (Removed)

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

This mixin has caused incompatibilities with the mod ImmediatelyFast v1.2

This is anticipated to be removed in v2.0.0 with the assumption that MTR 4 would comply with SemVer, and the modloader would be responsible for checking the MTR mod version rather than us.

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