private static void InitBefore() { RenderDebugText = new BoolSwitch(false, 30); RenderHitboxes = new BoolSwitch(false, 30); FluidManager.Init(); LogicManager.Init(); }
public override void OnRightClickWith(Players.Player player, Box <Shared.PlayerClickedData> boxedData) { if (null == player) { return; } ushort typeTouch; Vector3Int position = Vector3Int.maximum; if (World.TryGetTypeAt(boxedData.item1.VoxelHit, out typeTouch)) { position = boxedData.item1.VoxelHit; } else if (World.TryGetTypeAt(boxedData.item1.VoxelBuild, out typeTouch)) { position = boxedData.item1.VoxelBuild; } else { return; } foreach (ushort type in fluidsInfo.Keys) { if (type != typeTouch) { continue; } FluidManager.Remove(position, fluidsInfo[type]); Inventory inv = Inventory.GetInventory(player); inv.TryRemove(typeEmptyBucket); if (!inv.TryAdd(FluidManager._fluids[(int)fluidsInfo[type]].bucket)) { Stockpile.GetStockPile(player).Add(FluidManager._fluids[(int)fluidsInfo[type]].bucket, 1); } break; } }
public override void OnRightClickWith(Players.Player player, Pipliz.Box <Shared.PlayerClickedData> boxedData) { if (null == player) { return; } Pipliz.Vector3Int position = boxedData.item1.VoxelBuild; if (World.TryGetTypeAt(position, out ushort actualType) && actualType == BlockTypes.Builtin.BuiltinBlocks.Air) { FluidManager.Spread(position, fluid); Inventory inv = Inventory.GetInventory(player); inv.TryRemove(FluidManager._fluids[(int)fluid].bucket); if (!inv.TryAdd(EmptyBucket.typeEmptyBucket)) { Stockpile.GetStockPile(player).Add(EmptyBucket.typeEmptyBucket); } } }