@@ -64,7 +64,7 @@ public static void SetHarvestedKnifeStart(EntityBehaviorHarvestable __instance,
64
64
// Single player treatment and lan treatment
65
65
else if ( instance . clientAPI != null && instance . clientAPI . api . IsSinglePlayer )
66
66
{
67
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Knife_Harvest_Entity&lanplayername={ byPlayer . PlayerName } ") ;
67
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Knife_Harvest_Entity&lanplayername={ byPlayer . PlayerName } ") ;
68
68
69
69
// Get the final droprate
70
70
float dropRate = Configuration . KnifeGetHarvestMultiplyByLevel ( byPlayer . Entity . WatchedAttributes . GetInt ( "LevelUP_Level_Knife" ) ) + compatibilityDroprate ;
@@ -104,7 +104,7 @@ public static void OnHeldInteractStep(bool __result, float secondsUsed, ItemSlot
104
104
}
105
105
}
106
106
// Single player treatment and lan treatment
107
- else if ( instance . clientAPI != null && instance . clientAPI . api . IsSinglePlayer && secondsUsed >= 1.0f ) instance . clientAPI . compatibilityChannel . SendPacket ( $ "Soil_Till&lanplayername={ byEntity . GetName ( ) } ") ;
107
+ else if ( instance . clientAPI != null && instance . clientAPI . api . IsSinglePlayer && secondsUsed >= 1.0f ) instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Soil_Till&lanplayername={ byEntity . GetName ( ) } ") ;
108
108
}
109
109
110
110
// Overwrite Berry Forage while breaking
@@ -128,7 +128,7 @@ public static void GetDropsBerryBushFinish(BlockBerryBush __instance, IWorldAcce
128
128
// Single player treatment and lan treatment
129
129
else if ( instance . clientAPI ? . api . IsSinglePlayer ?? false )
130
130
{
131
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Farming_Harvest&forceexp={ exp } ") ;
131
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Farming_Harvest&forceexp={ exp } ") ;
132
132
}
133
133
}
134
134
}
@@ -155,7 +155,7 @@ public static void OnBlockInteractStopFinish(BlockBehaviorHarvestable __instance
155
155
// Single player treatment and lan treatment
156
156
else if ( instance . clientAPI ? . api . IsSinglePlayer ?? false )
157
157
{
158
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Farming_Harvest&forceexp={ exp } ") ;
158
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Farming_Harvest&forceexp={ exp } ") ;
159
159
}
160
160
}
161
161
}
@@ -182,7 +182,7 @@ public static void GetDropsMushroomFinish(BlockMushroom __instance, IWorldAccess
182
182
// Single player treatment and lan treatment
183
183
else if ( instance . clientAPI ? . api . IsSinglePlayer ?? false )
184
184
{
185
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Farming_Harvest&forceexp={ exp } ") ;
185
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Farming_Harvest&forceexp={ exp } ") ;
186
186
}
187
187
}
188
188
}
@@ -279,7 +279,7 @@ public static void HeatInput(BlockEntityFirepit __instance, float dt)
279
279
instance . serverAPI . OnExperienceEarned ( player as IServerPlayer , $ "Cooking_Finished&forceexp={ ( int ) Math . Round ( Configuration . ExpPerCookingcooking + ( Configuration . ExpPerCookingcooking * expMultiplySingle ) ) } ") ;
280
280
// Single player treatment and lan treatment
281
281
else if ( instance . clientAPI ? . api . IsSinglePlayer ?? false )
282
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Cooking_Finished&forceexp={ ( int ) Math . Round ( Configuration . ExpPerCookingcooking + ( Configuration . ExpPerCookingcooking * expMultiplySingle ) ) } &lanplayername={ player . PlayerName } ") ;
282
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Cooking_Finished&forceexp={ ( int ) Math . Round ( Configuration . ExpPerCookingcooking + ( Configuration . ExpPerCookingcooking * expMultiplySingle ) ) } &lanplayername={ player . PlayerName } ") ;
283
283
}
284
284
// For pots cooking
285
285
else if ( Configuration . expMultiplyPotsCooking . TryGetValue ( output . Collectible . Code . ToString ( ) , out double expMultiplyPots ) )
@@ -348,7 +348,7 @@ public static void HeatInput(BlockEntityFirepit __instance, float dt)
348
348
instance . serverAPI . OnExperienceEarned ( player as IServerPlayer , $ "Cooking_Finished&forceexp={ ( int ) Math . Round ( Configuration . ExpPerCookingcooking + ( Configuration . ExpPerCookingcooking * expMultiplyPots ) ) } ") ;
349
349
// Single player treatment and lan treatment
350
350
else if ( instance . clientAPI ? . api . IsSinglePlayer ?? false )
351
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Cooking_Finished&forceexp={ ( int ) Math . Round ( Configuration . ExpPerCookingcooking + ( Configuration . ExpPerCookingcooking * expMultiplyPots ) ) } &lanplayername={ player . PlayerName } ") ;
351
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Cooking_Finished&forceexp={ ( int ) Math . Round ( Configuration . ExpPerCookingcooking + ( Configuration . ExpPerCookingcooking * expMultiplyPots ) ) } &lanplayername={ player . PlayerName } ") ;
352
352
}
353
353
} ) ;
354
354
// Thread timeout
@@ -426,7 +426,7 @@ bool MatchesRecipe()
426
426
instance . serverAPI . OnExperienceEarned ( byPlayer as IServerPlayer , "Increase_Hammer_Hit" ) ;
427
427
// Single player treatment
428
428
else if ( instance . clientAPI ? . api . IsSinglePlayer ?? false )
429
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Increase_Hammer_Hit&lanplayername={ byPlayer . PlayerName } ") ;
429
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Increase_Hammer_Hit&lanplayername={ byPlayer . PlayerName } ") ;
430
430
}
431
431
}
432
432
}
@@ -649,7 +649,7 @@ static ItemStack Resolve(EnumItemClass type, string code)
649
649
}
650
650
651
651
// Increasing exp for panning
652
- instance . clientAPI . compatibilityChannel . SendPacket ( $ "Panning_Finished&lanplayername={ player . PlayerName } ") ;
652
+ instance . clientAPI . compatibilityChannel ? . SendPacket ( $ "Panning_Finished&lanplayername={ player . PlayerName } ") ;
653
653
}
654
654
655
655
}
0 commit comments