1- using MonoMod . Utils ;
2- using System . Reflection ;
3-
41namespace Celeste . Mod . CommunalHelper . Components ;
52
63[ TrackedAs ( typeof ( Holdable ) ) ]
74internal class DreamHoldable : Holdable
85{
9- private static readonly MethodInfo m_Player_Pickup = typeof ( Player ) . GetMethod ( "Pickup" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
10-
116 public readonly DreamDashCollider DreamDashCollider ;
127 public bool AllowDreamDash
138 {
@@ -27,14 +22,8 @@ public DreamHoldable(Collider dreamDashCollider, float cannotHoldDelay = 0.1f, A
2722
2823 private void OnDreamDashEnter ( Player player )
2924 {
30- DynamicData data = DynamicData . For ( player ) ;
31-
32- BloomPoint starFlyBloom = data . Get < BloomPoint > ( "starFlyBloom" ) ;
33-
3425 // Prevents a crash caused by entering the feather fly state while dream dashing through a dream holdable.
35- starFlyBloom ??= new ( new Vector2 ( 0f , - 6f ) , 0f , 16f ) { Visible = false } ;
36-
37- data . Set ( "starFlyBloom" , starFlyBloom ) ;
26+ player . starFlyBloom ??= new ( new Vector2 ( 0f , - 6f ) , 0f , 16f ) { Visible = false } ;
3827 }
3928
4029 public void OnDreamDashExit ( Player player )
@@ -43,10 +32,10 @@ public void OnDreamDashExit(Player player)
4332 if ( Input . GrabCheck && player . DashDir . Y <= 0 && player . Holding == null )
4433 {
4534 // force-allow pickup
46- player . GetData ( ) . Set ( " minHoldTimer" , 0f ) ;
35+ player . minHoldTimer = 0f ;
4736 cannotHoldTimer = 0f ;
4837
49- if ( ( bool ) m_Player_Pickup . Invoke ( player , new object [ ] { this } ) )
38+ if ( player . Pickup ( this ) )
5039 {
5140 player . StateMachine . State = Player . StPickup ;
5241 }
0 commit comments