Skip to content

Commit 02f3441

Browse files
committed
1.3.7-pre.1
1 parent 1738d91 commit 02f3441

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

LevelUP/Shared/OverrideBlockBreak.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static void OnBlockBrokenWith(ItemAxe __instance, IWorldAccessor world, E
8787
instance.serverAPI?.OnExperienceEarned(playerEntity.Player as IServerPlayer, "Tree_Breaked_Axe");
8888
}
8989
// Single player treatment and lan treatment
90-
else if (instance.clientAPI != null && instance.clientAPI.api.IsSinglePlayer) instance.clientAPI.compatibilityChannel.SendPacket($"Tree_Breaked_Axe&lanplayername={byEntity.GetName()}");
90+
else if (instance.clientAPI != null && instance.clientAPI.api.IsSinglePlayer) instance.clientAPI.compatibilityChannel?.SendPacket($"Tree_Breaked_Axe&lanplayername={byEntity.GetName()}");
9191
}
9292
}
9393

@@ -148,7 +148,7 @@ public static ItemStack[] GetDrops(ItemStack[] __result, BlockCrop __instance, I
148148
instance.serverAPI.OnExperienceEarned(byPlayer as IServerPlayer, $"Farming_Harvest&forceexp={exp}");
149149
// Single player treatment and lan treatment
150150
else if (instance.clientAPI?.api.IsSinglePlayer ?? false)
151-
instance.clientAPI.compatibilityChannel.SendPacket($"Farming_Harvest&forceexp={exp}");
151+
instance.clientAPI.compatibilityChannel?.SendPacket($"Farming_Harvest&forceexp={exp}");
152152
}
153153

154154
if (Configuration.enableExtendedLog)

LevelUP/Shared/OverrideBlockInteraction.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static void SetHarvestedKnifeStart(EntityBehaviorHarvestable __instance,
6464
// Single player treatment and lan treatment
6565
else if (instance.clientAPI != null && instance.clientAPI.api.IsSinglePlayer)
6666
{
67-
instance.clientAPI.compatibilityChannel.SendPacket($"Knife_Harvest_Entity&lanplayername={byPlayer.PlayerName}");
67+
instance.clientAPI.compatibilityChannel?.SendPacket($"Knife_Harvest_Entity&lanplayername={byPlayer.PlayerName}");
6868

6969
// Get the final droprate
7070
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
104104
}
105105
}
106106
// 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()}");
108108
}
109109

110110
// Overwrite Berry Forage while breaking
@@ -128,7 +128,7 @@ public static void GetDropsBerryBushFinish(BlockBerryBush __instance, IWorldAcce
128128
// Single player treatment and lan treatment
129129
else if (instance.clientAPI?.api.IsSinglePlayer ?? false)
130130
{
131-
instance.clientAPI.compatibilityChannel.SendPacket($"Farming_Harvest&forceexp={exp}");
131+
instance.clientAPI.compatibilityChannel?.SendPacket($"Farming_Harvest&forceexp={exp}");
132132
}
133133
}
134134
}
@@ -155,7 +155,7 @@ public static void OnBlockInteractStopFinish(BlockBehaviorHarvestable __instance
155155
// Single player treatment and lan treatment
156156
else if (instance.clientAPI?.api.IsSinglePlayer ?? false)
157157
{
158-
instance.clientAPI.compatibilityChannel.SendPacket($"Farming_Harvest&forceexp={exp}");
158+
instance.clientAPI.compatibilityChannel?.SendPacket($"Farming_Harvest&forceexp={exp}");
159159
}
160160
}
161161
}
@@ -182,7 +182,7 @@ public static void GetDropsMushroomFinish(BlockMushroom __instance, IWorldAccess
182182
// Single player treatment and lan treatment
183183
else if (instance.clientAPI?.api.IsSinglePlayer ?? false)
184184
{
185-
instance.clientAPI.compatibilityChannel.SendPacket($"Farming_Harvest&forceexp={exp}");
185+
instance.clientAPI.compatibilityChannel?.SendPacket($"Farming_Harvest&forceexp={exp}");
186186
}
187187
}
188188
}
@@ -279,7 +279,7 @@ public static void HeatInput(BlockEntityFirepit __instance, float dt)
279279
instance.serverAPI.OnExperienceEarned(player as IServerPlayer, $"Cooking_Finished&forceexp={(int)Math.Round(Configuration.ExpPerCookingcooking + (Configuration.ExpPerCookingcooking * expMultiplySingle))}");
280280
// Single player treatment and lan treatment
281281
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}");
283283
}
284284
// For pots cooking
285285
else if (Configuration.expMultiplyPotsCooking.TryGetValue(output.Collectible.Code.ToString(), out double expMultiplyPots))
@@ -348,7 +348,7 @@ public static void HeatInput(BlockEntityFirepit __instance, float dt)
348348
instance.serverAPI.OnExperienceEarned(player as IServerPlayer, $"Cooking_Finished&forceexp={(int)Math.Round(Configuration.ExpPerCookingcooking + (Configuration.ExpPerCookingcooking * expMultiplyPots))}");
349349
// Single player treatment and lan treatment
350350
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}");
352352
}
353353
});
354354
// Thread timeout
@@ -426,7 +426,7 @@ bool MatchesRecipe()
426426
instance.serverAPI.OnExperienceEarned(byPlayer as IServerPlayer, "Increase_Hammer_Hit");
427427
// Single player treatment
428428
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}");
430430
}
431431
}
432432
}
@@ -649,7 +649,7 @@ static ItemStack Resolve(EnumItemClass type, string code)
649649
}
650650

651651
// Increasing exp for panning
652-
instance.clientAPI.compatibilityChannel.SendPacket($"Panning_Finished&lanplayername={player.PlayerName}");
652+
instance.clientAPI.compatibilityChannel?.SendPacket($"Panning_Finished&lanplayername={player.PlayerName}");
653653
}
654654

655655
}

0 commit comments

Comments
 (0)